输出一行中获得礼物的人。如果没有人能得到礼物,输出“no one”,用C语言程序编写的解法

Problem Description
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.

Input
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.

Output
For each case, output the one who get the present in one line. If no one can get the present, output "No one".

Sample Input
3 1 3
1 2 2
1 3 3
2 3 1
3
2
1

Sample Output
1

1
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!

相似问题

0
MATLAB2017a中稀疏自动编码器工具包如何获得隐藏层输出?
1
为什么Zenmap的【Nmap输出】没有显示扫描信息
0
用C语言输出数字重新排列后最大的所有相邻两数乘积的和
1
有没有一种机器学习算法能够从几组数据中直接输出第几组数据是最优的?
1
C语言计算实现,字符串的编码值小于等于给定的值则输出yes,否则输出no
2
为什么显示输出超限呀?
3
有没有什么神经网络结构可以使输出是输入的排列组合?
1
zabbix_get取值和创建的脚本的输出不一致
0
输出菲波那切数列的第n项,完全按照例子输入和输出结果,可是一直没有写对,哪位大神可以帮我解答一下?
0
输出每个残影的计数位长度为3个字符长度,利用C程序的编程语言实现的办法怎么做
0
来大佬帮我看一个,最后的零怎么输出不了
0
C语言数据结构输出学号,表示各个学生的成绩,以学号递增顺序给出,第一个学生学号为1
0
输出包含擒杀所需最少步数的一行,则这个问题如何利用C语言的程序的代码的编写实现?
0
数组走到右上角时可以获得的最大金币数目,请问怎么样才能使用C语言的程序的编写的技术实现的?
0
走到右上角时可以获得的最大金币数目的运算,怎么采用C程序的语言代码编写技术去实现的呢?
1
运用C语言程序计算的问题:比赛的得分只有x分和y分两种形式,最大的不可以得到的分数是多少
1
IDEA build项目的时候,输出路径中没有js 文件?
0
用C语言的程序的代码编写思想的做法,去寻找一个年龄序列,满足这里的规律
0
判断是否存在,若存在一个最大的不可以得到的分数,则输出此分数,怎么使用C语言来计算
0
算法计算Lele要出多少才能保证自己买得到这块地,使用C语言的程序的代码的编写的思想怎么做