| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 32 | 23 | 22 | 73.333% |
One late afternoon you are driving to get home in your Big And Pricey Car. You have had a long day and are eager to get home as soon as possible. Your country's road network has many roads with varying speed limits, and has one strange quirk: at some time \(t\), the maximum speed on each road is raised. Because you want to get home as soon as possible, you instantly increase your speed to the new maximum speed of the road you are on at time \(t\).
You start driving at time \(0\) at junction \(1\) and are going to \(n\). What is the earliest time you can reach your destination? As an example, consider the first sample case, visualized in Figure L.1.
Figure L.1: Visualization of the first sample input. The edges are marked with their lengths. On all roads, the maximum speed is \(1\) before time \(t\) and \(2\) from time \(t\) onwards.
The input consists of:
There is at most one road between any two junctions, and one can travel in both directions on any road. No road leads from one junction to that same junction. It is guaranteed that there is always a path between any two junctions.
Output the minimum amount of time it takes to get from the start to your destination.
Your answer should have an absolute or relative error of at most 10ドル^{-6}$.
3 3 1 1 2 1 1 2 2 3 1 1 2 1 3 3 1 2
1.5
2 1 1 1 2 3 1 2
2.0
4 4 6 1 2 30 4 6 1 3 12 6 8 2 4 16 4 8 3 4 30 5 10
7.0
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2024 Preliminaries L번