![]() | ||||
Online Judge | Problem Set | Authors | Online Contests | User |
---|---|---|---|---|
Web Board Home Page F.A.Qs Announcement | Current Contest Past Contests Scheduled Contests Award Contest |
Remmarguts' Date Time Limit:4000MS Memory Limit:65536K
"Good man never makes girls wait or breaks an appointment!" said the
mandarin duck father. Softly touching his little ducks' head, he told
them a story.
The first line contains two
integer numbers N and M (1 <= N <= 1000, 0 <= M <= 100000).
Stations are numbered from 1 to N. Each of the following M lines
contains three integer numbers A, B and T (1 <= A, B <= N, 1
<= T <= 100). It shows that there is a directed sideway from A-th
station to B-th station with time T.
A single line consisting of a single integer number: the length (time required) to welcome Princess Uyuw using the K-th shortest path. If K-th shortest path does not exist, you should output "-1" (without quotes) instead. Sample Input2 2 1 2 5 2 1 4 1 2 2Sample Output
POJ Monthly,Zeyuan Zhu |
[Submit] [Go Back] [Status] [Discuss]
All Copyright Reserved 2003-2005 Ying Fuchen,Xu Pengcheng
Any problem, Please Contact Administrator