1993Way to Freedom

1993   Way to Freedom

题目描述

Background

"Now, you are getting closer and closer to Your Gate to Freedom!

And you will pass the most dangerous paths! Be careful!"

We're in a maze now. There're many rooms floating in the sky connected with wooden bridges. Bridges seems unstable...


Problem

At first, I'm in room X, and I want to go to room Y. There're N (N <= 100,000) rooms connected with M (M <= 1,000,000) edges. Each edge has a limit of weight, if weight exceeds this value, the edge will split, and drop me into the river.

How many things I can take to room Y at most?


输入格式:

This problem contains multiple test cases.

Each test case begins with two integers N and M, then M lines, each line has 3 numbers: X, Y and Weight (<=2,000,000,000).

输出格式:

For each test case, output the maximum weight I can take.

输入样例 复制
6 6
1 5 2000
2 4 5000
2 5 3300
3 4 2400
3 6 2200
4 6 6000
3 5
输出样例 复制
2400

说明

Contest: A Great Beloved and My Gate to Freedom
There is a cx, there is a love_cx.

2
3
通过提交
时空限制2000ms/32mb
题目来源JIANG, Yanyan's Contest #2
评测方式在线评测
题目类型
难        度