UVa10806_Dijkstra, Dijkstra.(网络流/费用流)(小白书图论专题)(二)

2015-07-20 17:49:53 · 作者: · 浏览: 10
e time both of you board the train. (Assume that you do not need to wait for the train - they leave every second.) If there is no solution, print "Back to jail".

Sample Input Sample Output
2
1
1 2 999
3
3
1 3 10
2 1 20
3 2 50
9
12
1 2 10
1 3 10
1 4 10
2 5 10
3 5 10
4 5 10
5 7 10
6 7 10
7 8 10
6 9 10
7 9 10
8 9 10
0
Back to jail
80
Back to jail


Problemsetter: Igor Naverniouk