Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
2024 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2023 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2392 . 滾遠一點
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
餘切
$\Huge\text{pooh is 8}$
User's AC Ratio
100.0% (
10/10
)
Submission's AC Ratio
76.9% (
10
/
13
)
Tags
Show solution-related tags
pre-nhspc-2024
全國模擬賽
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
5
3 4 2
1 2 6
4 2 5
2 5 3
Sample Output 1
copy
13 9
Sample Input 2
copy
5
3 4 1
1 2 2
4 2 1
2 5 2
Sample Output 2
copy
4 4
Hints
Problem Source
113 學年度全國資訊學科能力競賽模擬賽
Subtasks
No.
Testdata Range
Constraints
Score
1
0~1
範例測資
0
2
2~18
$k=2$
8
3
19~33
$k=n-1$
12
4
0~1, 34~53
$n\le 400$
10
5
0~1, 34~73
$n\le 5000$
14
6
0~18, 74~93
$k\le 800$
24
7
0~123
無額外限制
32
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
1500
524288
65536
1
4
5
6
7
1
1500
524288
65536
1
4
5
6
7
2
1500
524288
65536
2
6
7
3
1500
524288
65536
2
6
7
4
1500
524288
65536
2
6
7
5
1500
524288
65536
2
6
7
6
1500
524288
65536
2
6
7
7
1500
524288
65536
2
6
7
8
1500
524288
65536
2
6
7
9
1500
524288
65536
2
6
7
10
1500
524288
65536
2
6
7
11
1500
524288
65536
2
6
7
12
1500
524288
65536
2
6
7
13
1500
524288
65536
2
6
7
14
1500
524288
65536
2
6
7
15
1500
524288
65536
2
6
7
16
1500
524288
65536
2
6
7
17
1500
524288
65536
2
6
7
18
1500
524288
65536
2
6
7
19
1500
524288
65536
3
7
20
1500
524288
65536
3
7
21
1500
524288
65536
3
7
22
1500
524288
65536
3
7
23
1500
524288
65536
3
7
24
1500
524288
65536
3
7
25
1500
524288
65536
3
7
26
1500
524288
65536
3
7
27
1500
524288
65536
3
7
28
1500
524288
65536
3
7
29
1500
524288
65536
3
7
30
1500
524288
65536
3
7
31
1500
524288
65536
3
7
32
1500
524288
65536
3
7
33
1500
524288
65536
3
7
34
1500
524288
65536
4
5
7
35
1500
524288
65536
4
5
7
36
1500
524288
65536
4
5
7
37
1500
524288
65536
4
5
7
38
1500
524288
65536
4
5
7
39
1500
524288
65536
4
5
7
40
1500
524288
65536
4
5
7
41
1500
524288
65536
4
5
7
42
1500
524288
65536
4
5
7
43
1500
524288
65536
4
5
7
44
1500
524288
65536
4
5
7
45
1500
524288
65536
4
5
7
46
1500
524288
65536
4
5
7
47
1500
524288
65536
4
5
7
48
1500
524288
65536
4
5
7
49
1500
524288
65536
4
5
7
50
1500
524288
65536
4
5
7
51
1500
524288
65536
4
5
7
52
1500
524288
65536
4
5
7
53
1500
524288
65536
4
5
7
54
1500
524288
65536
5
7
55
1500
524288
65536
5
7
56
1500
524288
65536
5
7
57
1500
524288
65536
5
7
58
1500
524288
65536
5
7
59
1500
524288
65536
5
7
60
1500
524288
65536
5
7
61
1500
524288
65536
5
7
62
1500
524288
65536
5
7
63
1500
524288
65536
5
7
64
1500
524288
65536
5
7
65
1500
524288
65536
5
7
66
1500
524288
65536
5
7
67
1500
524288
65536
5
7
68
1500
524288
65536
5
7
69
1500
524288
65536
5
7
70
1500
524288
65536
5
7
71
1500
524288
65536
5
7
72
1500
524288
65536
5
7
73
1500
524288
65536
5
7
74
1500
524288
65536
6
7
75
1500
524288
65536
6
7
76
1500
524288
65536
6
7
77
1500
524288
65536
6
7
78
1500
524288
65536
6
7
79
1500
524288
65536
6
7
80
1500
524288
65536
6
7
81
1500
524288
65536
6
7
82
1500
524288
65536
6
7
83
1500
524288
65536
6
7
84
1500
524288
65536
6
7
85
1500
524288
65536
6
7
86
1500
524288
65536
6
7
87
1500
524288
65536
6
7
88
1500
524288
65536
6
7
89
1500
524288
65536
6
7
90
1500
524288
65536
6
7
91
1500
524288
65536
6
7
92
1500
524288
65536
6
7
93
1500
524288
65536
6
7
94
1500
524288
65536
7
95
1500
524288
65536
7
96
1500
524288
65536
7
97
1500
524288
65536
7
98
1500
524288
65536
7
99
1500
524288
65536
7
100
1500
524288
65536
7
101
1500
524288
65536
7
102
1500
524288
65536
7
103
1500
524288
65536
7
104
1500
524288
65536
7
105
1500
524288
65536
7
106
1500
524288
65536
7
107
1500
524288
65536
7
108
1500
524288
65536
7
109
1500
524288
65536
7
110
1500
524288
65536
7
111
1500
524288
65536
7
112
1500
524288
65536
7
113
1500
524288
65536
7
114
1500
524288
65536
7
115
1500
524288
65536
7
116
1500
524288
65536
7
117
1500
524288
65536
7
118
1500
524288
65536
7
119
1500
524288
65536
7
120
1500
524288
65536
7
121
1500
524288
65536
7
122
1500
524288
65536
7
123
1500
524288
65536
7
Submit
Back to Top