Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
2024 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2023 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2395 . 鐵路規劃
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
C0DET1GER
User's AC Ratio
100.0% (
5/5
)
Submission's AC Ratio
100.0% (
6
/
6
)
Tags
Show solution-related tags
pre-nhspc-2024
全國模擬賽
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
4 4
1 2
2 3
3 4
4 1
Sample Output 1
copy
RBRB
Sample Input 2
copy
4 4
1 2
2 3
3 1
1 4
Sample Output 2
copy
RBRB
Sample Input 3
copy
4 5
1 2
1 3
1 4
2 3
3 4
Sample Output 3
copy
RRBBR
Hints
Problem Source
113 學年度全國資訊學科能力競賽模擬賽
Subtasks
No.
Testdata Range
Constraints
Score
1
0~2
範例測資
0
2
0~34
$n\le 7$
12
3
0, 35~47
所有小鎮皆與兩條鐵路相鄰。
12
4
0~1, 35~70
$n=m$
28
5
0~40, 48~60, 71~113
$n\le 2000,m\le 4000$
16
6
0~148
無額外限制
32
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
3000
524288
65536
1
2
3
4
5
6
1
3000
524288
65536
1
2
4
5
6
2
3000
524288
65536
1
2
5
6
3
3000
524288
65536
2
5
6
4
3000
524288
65536
2
5
6
5
3000
524288
65536
2
5
6
6
3000
524288
65536
2
5
6
7
3000
524288
65536
2
5
6
8
3000
524288
65536
2
5
6
9
3000
524288
65536
2
5
6
10
3000
524288
65536
2
5
6
11
3000
524288
65536
2
5
6
12
3000
524288
65536
2
5
6
13
3000
524288
65536
2
5
6
14
3000
524288
65536
2
5
6
15
3000
524288
65536
2
5
6
16
3000
524288
65536
2
5
6
17
3000
524288
65536
2
5
6
18
3000
524288
65536
2
5
6
19
3000
524288
65536
2
5
6
20
3000
524288
65536
2
5
6
21
3000
524288
65536
2
5
6
22
3000
524288
65536
2
5
6
23
3000
524288
65536
2
5
6
24
3000
524288
65536
2
5
6
25
3000
524288
65536
2
5
6
26
3000
524288
65536
2
5
6
27
3000
524288
65536
2
5
6
28
3000
524288
65536
2
5
6
29
3000
524288
65536
2
5
6
30
3000
524288
65536
2
5
6
31
3000
524288
65536
2
5
6
32
3000
524288
65536
2
5
6
33
3000
524288
65536
2
5
6
34
3000
524288
65536
2
5
6
35
3000
524288
65536
3
4
5
6
36
3000
524288
65536
3
4
5
6
37
3000
524288
65536
3
4
5
6
38
3000
524288
65536
3
4
5
6
39
3000
524288
65536
3
4
5
6
40
3000
524288
65536
3
4
5
6
41
3000
524288
65536
3
4
6
42
3000
524288
65536
3
4
6
43
3000
524288
65536
3
4
6
44
3000
524288
65536
3
4
6
45
3000
524288
65536
3
4
6
46
3000
524288
65536
3
4
6
47
3000
524288
65536
3
4
6
48
3000
524288
65536
4
5
6
49
3000
524288
65536
4
5
6
50
3000
524288
65536
4
5
6
51
3000
524288
65536
4
5
6
52
3000
524288
65536
4
5
6
53
3000
524288
65536
4
5
6
54
3000
524288
65536
4
5
6
55
3000
524288
65536
4
5
6
56
3000
524288
65536
4
5
6
57
3000
524288
65536
4
5
6
58
3000
524288
65536
4
5
6
59
3000
524288
65536
4
5
6
60
3000
524288
65536
4
5
6
61
3000
524288
65536
4
6
62
3000
524288
65536
4
6
63
3000
524288
65536
4
6
64
3000
524288
65536
4
6
65
3000
524288
65536
4
6
66
3000
524288
65536
4
6
67
3000
524288
65536
4
6
68
3000
524288
65536
4
6
69
3000
524288
65536
4
6
70
3000
524288
65536
4
6
71
3000
524288
65536
5
6
72
3000
524288
65536
5
6
73
3000
524288
65536
5
6
74
3000
524288
65536
5
6
75
3000
524288
65536
5
6
76
3000
524288
65536
5
6
77
3000
524288
65536
5
6
78
3000
524288
65536
5
6
79
3000
524288
65536
5
6
80
3000
524288
65536
5
6
81
3000
524288
65536
5
6
82
3000
524288
65536
5
6
83
3000
524288
65536
5
6
84
3000
524288
65536
5
6
85
3000
524288
65536
5
6
86
3000
524288
65536
5
6
87
3000
524288
65536
5
6
88
3000
524288
65536
5
6
89
3000
524288
65536
5
6
90
3000
524288
65536
5
6
91
3000
524288
65536
5
6
92
3000
524288
65536
5
6
93
3000
524288
65536
5
6
94
3000
524288
65536
5
6
95
3000
524288
65536
5
6
96
3000
524288
65536
5
6
97
3000
524288
65536
5
6
98
3000
524288
65536
5
6
99
3000
524288
65536
5
6
100
3000
524288
65536
5
6
101
3000
524288
65536
5
6
102
3000
524288
65536
5
6
103
3000
524288
65536
5
6
104
3000
524288
65536
5
6
105
3000
524288
65536
5
6
106
3000
524288
65536
5
6
107
3000
524288
65536
5
6
108
3000
524288
65536
5
6
109
3000
524288
65536
5
6
110
3000
524288
65536
5
6
111
3000
524288
65536
5
6
112
3000
524288
65536
5
6
113
3000
524288
65536
5
6
114
3000
524288
65536
6
115
3000
524288
65536
6
116
3000
524288
65536
6
117
3000
524288
65536
6
118
3000
524288
65536
6
119
3000
524288
65536
6
120
3000
524288
65536
6
121
3000
524288
65536
6
122
3000
524288
65536
6
123
3000
524288
65536
6
124
3000
524288
65536
6
125
3000
524288
65536
6
126
3000
524288
65536
6
127
3000
524288
65536
6
128
3000
524288
65536
6
129
3000
524288
65536
6
130
3000
524288
65536
6
131
3000
524288
65536
6
132
3000
524288
65536
6
133
3000
524288
65536
6
134
3000
524288
65536
6
135
3000
524288
65536
6
136
3000
524288
65536
6
137
3000
524288
65536
6
138
3000
524288
65536
6
139
3000
524288
65536
6
140
3000
524288
65536
6
141
3000
524288
65536
6
142
3000
524288
65536
6
143
3000
524288
65536
6
144
3000
524288
65536
6
145
3000
524288
65536
6
146
3000
524288
65536
6
147
3000
524288
65536
6
148
3000
524288
65536
6
Submit
Back to Top