题目描述
Because he is a robot, Timmy the area he has to travel in as a series of numbered points (maximum 150), and aclculations of the distance between pairs of these points.
The inputs to the program are as follows:
The first line will contain a pair of integer values a & b, where a represents the number of the point Timmy will be leaving from and b represents the number of the point timmy will be travelling to.
The second line will contain the number of points N (N <= 150). Points are numbered 0 to N - 1.
The third line will contain the number of connections between these points E (E <= 2500)
All of the remaining E lines will contain three values, two points with indexes i&j and the distance k between them (These pairs of points can be travelled in both directions)
输入格式
First line you should input two number a and b (0<=a<=b<=N)
Second line you should input a single number N (N<=150)
Third line you should input a single number E (E<=2500)
then there will be several lines to enter the distance between two points with the order of i, j, k (i<=j)
输出格式
样例输入
0 5 10 23 0 2 2 0 3 2 0 6 10 0 7 2 0 8 4 1 3 9 1 4 4 1 5 3 1 8 2 2 5 8 2 7 7 2 8 3 3 4 10 3 5 8 3 6 4 3 9 9 4 6 6 4 8 5 4 9 10 5 6 8 5 8 8 6 7 6 7 9 9
样例输出
0 - 8 - 1 - 5 Total distance: 9
比赛公告
题号:2191,2192,2193,2194,2195,2196,2197,2198,2199,2200
点击上方导航栏的训练,点击题库,寻找题号即可找到对应题目,比赛结束后,请通过训练->题库->寻找对应题目的方式做题
因为不确定因素太多,就不再安排大家轮流讲题了,大家做不出题可以在测试结束后去题库找对应的题目看题解,希望大家自觉练习,认真练习,考核测试会采取不同与现在测试的方式,两个月后综合测试成绩不达标者会退出实验室,希望大家认真对待