当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2145:zz's Mysterious Present

题目描述
There are m people in n cities, and they all want to attend the party which hold by zz. They set out at the same time, and they all will choose the best way they think, but due to someone take a ride, someone drive, and someone take a taxi, they have different speed. Can you find out who will get zz's mysterious present? The first one get the party will get the present . If there are several people get at the same time, the one who stay in the city which is farther from the city where is zz at begin will get the present. If there are several people get at the same time and the distance from the city he is at begin to the city where zz is, the one who has the larger number will get the present.
输入解释
The first line: three integers n, m and k. m is the total number of the people, and n is the total number of cities, and k is the number of the way.(0<n<=300, 0<m<=n, 0<k<5000)
The second line to the (k+1)th line: three integers a, b and c. There is a way from a to b, and the length of the way is c.(0<a,b<=n, 0<c<=100)
The (k+2)th line: one integer p(0<p<=n), p is the city where zz is.
The (k+3)th line: m integers. the ith people is at the place p[i] at begin.(0<p[i]<=n)
The (k+4)th line: m integers. the speed of the ith people is speed[i];(0<speed[i]<=100)
All the ways are directed.
输出解释
For each case, output the one who get the present in one line. If no one can get the present, output "No one".
输入样例
3 1 3
1 2 2
1 3 3
2 3 1
3
2
1
输出样例
1
来自杭电HDUOJ的附加信息
Author 李光霞
Recommend 威士忌

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2145

最后修改于 2020-10-25T22:50:53+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000/1000MS(Java/Others) 65536/32768K(Java/Others)