99 人解决,119 人已尝试。
165 份提交通过,共有 344 份提交。
2.9 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
Kid has got the diamond ring after he got the password. After that he tried to escape as quickly as possible. Now give you the map, point 0 stands for Kid, point 1 stands for the exit.
There are n (2<=n<=100) points (from 0 to n-1), r roads, given in a line. Different distances between points are given, one line for each road with three integers s, e, l(0<=s, e<=n-1, 0<l<=1000), stands for the road between the point s and e, length l.
Please find out the shortest way for Kid to escape. Just output the length of the way you’ve found.
5 6 0 2 2 0 3 2 2 3 3 0 4 12 3 1 34 4 1 24
36
99 人解决,119 人已尝试。
165 份提交通过,共有 344 份提交。
2.9 EMB 奖励。