Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
2024 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2023 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2407 . 交通優惠券
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
fatman
$\huge{\text{2024北市賽rk.4不是我}}$
User's AC Ratio
100.0% (
3/3
)
Submission's AC Ratio
100.0% (
3
/
3
)
Tags
Show solution-related tags
pre-nhspc-2023
全國模擬賽
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
6 7 1 6 2 3
1 2 2
1 3 8
2 4 7
2 5 10
3 4 3
4 6 12
5 6 8
Sample Output 1
copy
7
Sample Input 2
copy
6 7 1 6 6 3
1 2 2
1 3 8
2 4 7
2 5 10
3 4 3
4 6 12
5 6 8
Sample Output 2
copy
11
Hints
Problem Source
112 學年度全國資訊學科能力競賽模擬賽
Subtasks
No.
Testdata Range
Constraints
Score
1
0~1
範例測資
0
2
2~4, 80~96
$A = T$
21
3
0~1, 5~23
$M \leq 100$
9
4
0~1, 5~43
$M \leq 2000$
17
5
0~1, 5~66, 80~96
$N \leq 80000, M \leq 10^ 5$
35
6
0~96
無額外限制
18
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
2500
524288
65536
1
3
4
5
6
1
2500
524288
65536
1
3
4
5
6
2
2500
524288
65536
2
6
3
2500
524288
65536
2
6
4
2500
524288
65536
2
6
5
2500
524288
65536
3
4
5
6
6
2500
524288
65536
3
4
5
6
7
2500
524288
65536
3
4
5
6
8
2500
524288
65536
3
4
5
6
9
2500
524288
65536
3
4
5
6
10
2500
524288
65536
3
4
5
6
11
2500
524288
65536
3
4
5
6
12
2500
524288
65536
3
4
5
6
13
2500
524288
65536
3
4
5
6
14
2500
524288
65536
3
4
5
6
15
2500
524288
65536
3
4
5
6
16
2500
524288
65536
3
4
5
6
17
2500
524288
65536
3
4
5
6
18
2500
524288
65536
3
4
5
6
19
2500
524288
65536
3
4
5
6
20
2500
524288
65536
3
4
5
6
21
2500
524288
65536
3
4
5
6
22
2500
524288
65536
3
4
5
6
23
2500
524288
65536
3
4
5
6
24
2500
524288
65536
4
5
6
25
2500
524288
65536
4
5
6
26
2500
524288
65536
4
5
6
27
2500
524288
65536
4
5
6
28
2500
524288
65536
4
5
6
29
2500
524288
65536
4
5
6
30
2500
524288
65536
4
5
6
31
2500
524288
65536
4
5
6
32
2500
524288
65536
4
5
6
33
2500
524288
65536
4
5
6
34
2500
524288
65536
4
5
6
35
2500
524288
65536
4
5
6
36
2500
524288
65536
4
5
6
37
2500
524288
65536
4
5
6
38
2500
524288
65536
4
5
6
39
2500
524288
65536
4
5
6
40
2500
524288
65536
4
5
6
41
2500
524288
65536
4
5
6
42
2500
524288
65536
4
5
6
43
2500
524288
65536
4
5
6
44
2500
524288
65536
5
6
45
2500
524288
65536
5
6
46
2500
524288
65536
5
6
47
2500
524288
65536
5
6
48
2500
524288
65536
5
6
49
2500
524288
65536
5
6
50
2500
524288
65536
5
6
51
2500
524288
65536
5
6
52
2500
524288
65536
5
6
53
2500
524288
65536
5
6
54
2500
524288
65536
5
6
55
2500
524288
65536
5
6
56
2500
524288
65536
5
6
57
2500
524288
65536
5
6
58
2500
524288
65536
5
6
59
2500
524288
65536
5
6
60
2500
524288
65536
5
6
61
2500
524288
65536
5
6
62
2500
524288
65536
5
6
63
2500
524288
65536
5
6
64
2500
524288
65536
5
6
65
2500
524288
65536
5
6
66
2500
524288
65536
5
6
67
2500
524288
65536
6
68
2500
524288
65536
6
69
2500
524288
65536
6
70
2500
524288
65536
6
71
2500
524288
65536
6
72
2500
524288
65536
6
73
2500
524288
65536
6
74
2500
524288
65536
6
75
2500
524288
65536
6
76
2500
524288
65536
6
77
2500
524288
65536
6
78
2500
524288
65536
6
79
2500
524288
65536
6
80
2500
524288
65536
2
5
6
81
2500
524288
65536
2
5
6
82
2500
524288
65536
2
5
6
83
2500
524288
65536
2
5
6
84
2500
524288
65536
2
5
6
85
2500
524288
65536
2
5
6
86
2500
524288
65536
2
5
6
87
2500
524288
65536
2
5
6
88
2500
524288
65536
2
5
6
89
2500
524288
65536
2
5
6
90
2500
524288
65536
2
5
6
91
2500
524288
65536
2
5
6
92
2500
524288
65536
2
5
6
93
2500
524288
65536
2
5
6
94
2500
524288
65536
2
5
6
95
2500
524288
65536
2
5
6
96
2500
524288
65536
2
5
6
Submit
Back to Top