TopCoder

User's AC Ratio

75.0% (3/4)

Submission's AC Ratio

33.3% (4/12)

Tags

Description

題目 PDF 檔在這裡

註:題本的測資範圍有誤,實際為 $N, M \leq 3 \times 10^ 5$。

Input Format

Output Format

Sample Input 1

2 2 10
1 2 1 2
1 2 8 9

Sample Output 1

4

Sample Input 2

3 5 1000000000
1 2 100000001 300000000
2 3 200000001 800000000
1 3 400000001 600000000
2 1 700000001 1000000000
3 3 123456789 987654321

Sample Output 2

700000000 400000000

Sample Input 3

6 10 30
6 5 22 29
5 6 14 23
6 2 21 27
6 1 5 12
5 1 21 28
2 4 3 9
6 5 26 30
4 5 1 30
6 1 3 12
4 1 4 15

Sample Output 3

13 0 20 20 20

Hints

Problem Source

YTP 2021 高中組程式挑戰營 p13

Subtasks

No. Testdata Range Constraints Score
1 0~2 範例測資 0
2 0, 2~12 $N, M, K \leq 5000$ 12
3 0~22 無額外限制 13

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 4000 524288 65536 1 2 3
1 4000 524288 65536 1 3
2 4000 524288 65536 1 2 3
3 4000 524288 65536 2 3
4 4000 524288 65536 2 3
5 4000 524288 65536 2 3
6 4000 524288 65536 2 3
7 4000 524288 65536 2 3
8 4000 524288 65536 2 3
9 4000 524288 65536 2 3
10 4000 524288 65536 2 3
11 4000 524288 65536 2 3
12 4000 524288 65536 2 3
13 4000 524288 65536 3
14 4000 524288 65536 3
15 4000 524288 65536 3
16 4000 524288 65536 3
17 4000 524288 65536 3
18 4000 524288 65536 3
19 4000 524288 65536 3
20 4000 524288 65536 3
21 4000 524288 65536 3
22 4000 524288 65536 3