Logo
(追記) (追記ここまで)

32548번 - Lawful Limits 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB32232273.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:

  • One line with three integers \(n\), \(m\), and \(t\) (\(2\leq n\leq10^5\), \(1\leq m\leq10^5\), \(0\leq t\leq10^9\)), the number of junctions, the number of roads, and the time the speed limit increases.
  • \(m\) lines, each with five integers \(x\), \(y\), \(\ell\), \(v\), and \(w\) (\(1\leq x,y\leq n\), \(1\leq\ell\leq10^9\), \(1\leq v<w\leq10^9\)), the start and end junction of a road, length of this road, and the speed limits on this road before time \(t\) and from time \(t\) onwards.

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}$.

제한

예제 입력 1

3 3 1
1 2 1 1 2
2 3 1 1 2
1 3 3 1 2

예제 출력 1

1.5

예제 입력 2

2 1 1
1 2 3 1 2

예제 출력 2

2.0

예제 입력 3

4 4 6
1 2 30 4 6
1 3 12 6 8
2 4 16 4 8
3 4 30 5 10

예제 출력 3

7.0

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2024 Preliminaries L번

  • 문제를 만든 사람: Dirk van Bree
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /