Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
NTUCPC Speed Run! #1
比賽已結束,感謝大家的參與!
題目連結
IOICamp 2025 PreExam 進行中!
IOICamp 官網
、
PreExam 連結
程式解題社網站
程式解題社網站
上線了!
389 . 往花那家的路上
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
anon_tokyo
User's AC Ratio
75.0% (
3/4
)
Submission's AC Ratio
33.3% (
4
/
12
)
Tags
Show solution-related tags
ytp
ytp-senior
ytp-2021
Description
題目 PDF 檔在這裡
註:題本的測資範圍有誤,實際為 $N, M \leq 3 \times 10^ 5$。
Input Format
Output Format
Sample Input 1
copy
2 2 10
1 2 1 2
1 2 8 9
Sample Output 1
copy
4
Sample Input 2
copy
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
copy
700000000 400000000
Sample Input 3
copy
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
copy
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
Submit
Back to Top