Farmer John is on a boat seeking fabled treasure on one of the N (1
Farmer John is on a boat seeking fabled treasure on one of the N (1 <= N <= 100) islands conveniently labeled 1..N in the Cowribbean Sea. The treasure map tells him that he must travel through a certain sequence A1, A2, ..., AM of M (2 <= M <= 10,000) islands, starting on island 1 and ending on island N before the treasure will appear to him. He can visit these and other islands out of order and even more than once, but his trip must include the Ai sequence in the order specified by the map. FJ wants to avoid pirates and knows the pirate-danger rating (0 <= danger <= 100,000) between each pair of islands. The total danger rating of his mission is the sum of the danger ratings of all the paths he traverses. Help Farmer John find the least dangerous route to the treasure that satisfies the treasure map's requirement.
标签: HBC25005[网络流24题]飞行员配对方案问题[USACO 2008 Ope S]Clear And Present Danger题解