Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
2022 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2023 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2024 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2333 . D. 分子環 (molecule)
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
abcabcabc
快去寫 TIOJ 2311 > <
User's AC Ratio
33.3% (
2/6
)
Submission's AC Ratio
16.1% (
5
/
31
)
Tags
Show solution-related tags
TOI
TOI-pre
2023-TOI-pre
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
2 1 1
Sample Output 1
copy
-1
Sample Input 2
copy
2 1 2
Sample Output 2
copy
2
XXYXY
Sample Input 3
copy
0 0 4
Sample Output 3
copy
2
XXYY
Sample Input 4
copy
4 4 0
Sample Output 4
copy
1
XYXYXYXY
Sample Input 5
copy
5 3 10
Sample Output 5
copy
3
XYYYXYYXYXXXYXXYXX
Hints
Problem Source
2023 TOI 初選
測資來源:
TWPCA GitHub
Subtasks
No.
Testdata Range
Constraints
Score
1
0~4
範例測資
0
2
0~3, 5~103
$a+b+c \le 15$
8
3
0~177
$a,b,c \le 20$
29
4
178~221
$b = 0$ 且 $2a \ge c$
21
5
0~296
無額外限制
42
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
500
524288
65536
1
2
3
5
1
500
524288
65536
1
2
3
5
2
500
524288
65536
1
2
3
5
3
500
524288
65536
1
2
3
5
4
500
524288
65536
1
3
5
5
500
524288
65536
2
3
5
6
500
524288
65536
2
3
5
7
500
524288
65536
2
3
5
8
500
524288
65536
2
3
5
9
500
524288
65536
2
3
5
10
500
524288
65536
2
3
5
11
500
524288
65536
2
3
5
12
500
524288
65536
2
3
5
13
500
524288
65536
2
3
5
14
500
524288
65536
2
3
5
15
500
524288
65536
2
3
5
16
500
524288
65536
2
3
5
17
500
524288
65536
2
3
5
18
500
524288
65536
2
3
5
19
500
524288
65536
2
3
5
20
500
524288
65536
2
3
5
21
500
524288
65536
2
3
5
22
500
524288
65536
2
3
5
23
500
524288
65536
2
3
5
24
500
524288
65536
2
3
5
25
500
524288
65536
2
3
5
26
500
524288
65536
2
3
5
27
500
524288
65536
2
3
5
28
500
524288
65536
2
3
5
29
500
524288
65536
2
3
5
30
500
524288
65536
2
3
5
31
500
524288
65536
2
3
5
32
500
524288
65536
2
3
5
33
500
524288
65536
2
3
5
34
500
524288
65536
2
3
5
35
500
524288
65536
2
3
5
36
500
524288
65536
2
3
5
37
500
524288
65536
2
3
5
38
500
524288
65536
2
3
5
39
500
524288
65536
2
3
5
40
500
524288
65536
2
3
5
41
500
524288
65536
2
3
5
42
500
524288
65536
2
3
5
43
500
524288
65536
2
3
5
44
500
524288
65536
2
3
5
45
500
524288
65536
2
3
5
46
500
524288
65536
2
3
5
47
500
524288
65536
2
3
5
48
500
524288
65536
2
3
5
49
500
524288
65536
2
3
5
50
500
524288
65536
2
3
5
51
500
524288
65536
2
3
5
52
500
524288
65536
2
3
5
53
500
524288
65536
2
3
5
54
500
524288
65536
2
3
5
55
500
524288
65536
2
3
5
56
500
524288
65536
2
3
5
57
500
524288
65536
2
3
5
58
500
524288
65536
2
3
5
59
500
524288
65536
2
3
5
60
500
524288
65536
2
3
5
61
500
524288
65536
2
3
5
62
500
524288
65536
2
3
5
63
500
524288
65536
2
3
5
64
500
524288
65536
2
3
5
65
500
524288
65536
2
3
5
66
500
524288
65536
2
3
5
67
500
524288
65536
2
3
5
68
500
524288
65536
2
3
5
69
500
524288
65536
2
3
5
70
500
524288
65536
2
3
5
71
500
524288
65536
2
3
5
72
500
524288
65536
2
3
5
73
500
524288
65536
2
3
5
74
500
524288
65536
2
3
5
75
500
524288
65536
2
3
5
76
500
524288
65536
2
3
5
77
500
524288
65536
2
3
5
78
500
524288
65536
2
3
5
79
500
524288
65536
2
3
5
80
500
524288
65536
2
3
5
81
500
524288
65536
2
3
5
82
500
524288
65536
2
3
5
83
500
524288
65536
2
3
5
84
500
524288
65536
2
3
5
85
500
524288
65536
2
3
5
86
500
524288
65536
2
3
5
87
500
524288
65536
2
3
5
88
500
524288
65536
2
3
5
89
500
524288
65536
2
3
5
90
500
524288
65536
2
3
5
91
500
524288
65536
2
3
5
92
500
524288
65536
2
3
5
93
500
524288
65536
2
3
5
94
500
524288
65536
2
3
5
95
500
524288
65536
2
3
5
96
500
524288
65536
2
3
5
97
500
524288
65536
2
3
5
98
500
524288
65536
2
3
5
99
500
524288
65536
2
3
5
100
500
524288
65536
2
3
5
101
500
524288
65536
2
3
5
102
500
524288
65536
2
3
5
103
500
524288
65536
2
3
5
104
500
524288
65536
3
5
105
500
524288
65536
3
5
106
500
524288
65536
3
5
107
500
524288
65536
3
5
108
500
524288
65536
3
5
109
500
524288
65536
3
5
110
500
524288
65536
3
5
111
500
524288
65536
3
5
112
500
524288
65536
3
5
113
500
524288
65536
3
5
114
500
524288
65536
3
5
115
500
524288
65536
3
5
116
500
524288
65536
3
5
117
500
524288
65536
3
5
118
500
524288
65536
3
5
119
500
524288
65536
3
5
120
500
524288
65536
3
5
121
500
524288
65536
3
5
122
500
524288
65536
3
5
123
500
524288
65536
3
5
124
500
524288
65536
3
5
125
500
524288
65536
3
5
126
500
524288
65536
3
5
127
500
524288
65536
3
5
128
500
524288
65536
3
5
129
500
524288
65536
3
5
130
500
524288
65536
3
5
131
500
524288
65536
3
5
132
500
524288
65536
3
5
133
500
524288
65536
3
5
134
500
524288
65536
3
5
135
500
524288
65536
3
5
136
500
524288
65536
3
5
137
500
524288
65536
3
5
138
500
524288
65536
3
5
139
500
524288
65536
3
5
140
500
524288
65536
3
5
141
500
524288
65536
3
5
142
500
524288
65536
3
5
143
500
524288
65536
3
5
144
500
524288
65536
3
5
145
500
524288
65536
3
5
146
500
524288
65536
3
5
147
500
524288
65536
3
5
148
500
524288
65536
3
5
149
500
524288
65536
3
5
150
500
524288
65536
3
5
151
500
524288
65536
3
5
152
500
524288
65536
3
5
153
500
524288
65536
3
5
154
500
524288
65536
3
5
155
500
524288
65536
3
5
156
500
524288
65536
3
5
157
500
524288
65536
3
5
158
500
524288
65536
3
5
159
500
524288
65536
3
5
160
500
524288
65536
3
5
161
500
524288
65536
3
5
162
500
524288
65536
3
5
163
500
524288
65536
3
5
164
500
524288
65536
3
5
165
500
524288
65536
3
5
166
500
524288
65536
3
5
167
500
524288
65536
3
5
168
500
524288
65536
3
5
169
500
524288
65536
3
5
170
500
524288
65536
3
5
171
500
524288
65536
3
5
172
500
524288
65536
3
5
173
500
524288
65536
3
5
174
500
524288
65536
3
5
175
500
524288
65536
3
5
176
500
524288
65536
3
5
177
500
524288
65536
3
5
178
500
524288
65536
4
5
179
500
524288
65536
4
5
180
500
524288
65536
4
5
181
500
524288
65536
4
5
182
500
524288
65536
4
5
183
500
524288
65536
4
5
184
500
524288
65536
4
5
185
500
524288
65536
4
5
186
500
524288
65536
4
5
187
500
524288
65536
4
5
188
500
524288
65536
4
5
189
500
524288
65536
4
5
190
500
524288
65536
4
5
191
500
524288
65536
4
5
192
500
524288
65536
4
5
193
500
524288
65536
4
5
194
500
524288
65536
4
5
195
500
524288
65536
4
5
196
500
524288
65536
4
5
197
500
524288
65536
4
5
198
500
524288
65536
4
5
199
500
524288
65536
4
5
200
500
524288
65536
4
5
201
500
524288
65536
4
5
202
500
524288
65536
4
5
203
500
524288
65536
4
5
204
500
524288
65536
4
5
205
500
524288
65536
4
5
206
500
524288
65536
4
5
207
500
524288
65536
4
5
208
500
524288
65536
4
5
209
500
524288
65536
4
5
210
500
524288
65536
4
5
211
500
524288
65536
4
5
212
500
524288
65536
4
5
213
500
524288
65536
4
5
214
500
524288
65536
4
5
215
500
524288
65536
4
5
216
500
524288
65536
4
5
217
500
524288
65536
4
5
218
500
524288
65536
4
5
219
500
524288
65536
4
5
220
500
524288
65536
4
5
221
500
524288
65536
4
5
222
500
524288
65536
5
223
500
524288
65536
5
224
500
524288
65536
5
225
500
524288
65536
5
226
500
524288
65536
5
227
500
524288
65536
5
228
500
524288
65536
5
229
500
524288
65536
5
230
500
524288
65536
5
231
500
524288
65536
5
232
500
524288
65536
5
233
500
524288
65536
5
234
500
524288
65536
5
235
500
524288
65536
5
236
500
524288
65536
5
237
500
524288
65536
5
238
500
524288
65536
5
239
500
524288
65536
5
240
500
524288
65536
5
241
500
524288
65536
5
242
500
524288
65536
5
243
500
524288
65536
5
244
500
524288
65536
5
245
500
524288
65536
5
246
500
524288
65536
5
247
500
524288
65536
5
248
500
524288
65536
5
249
500
524288
65536
5
250
500
524288
65536
5
251
500
524288
65536
5
252
500
524288
65536
5
253
500
524288
65536
5
254
500
524288
65536
5
255
500
524288
65536
5
256
500
524288
65536
5
257
500
524288
65536
5
258
500
524288
65536
5
259
500
524288
65536
5
260
500
524288
65536
5
261
500
524288
65536
5
262
500
524288
65536
5
263
500
524288
65536
5
264
500
524288
65536
5
265
500
524288
65536
5
266
500
524288
65536
5
267
500
524288
65536
5
268
500
524288
65536
5
269
500
524288
65536
5
270
500
524288
65536
5
271
500
524288
65536
5
272
500
524288
65536
5
273
500
524288
65536
5
274
500
524288
65536
5
275
500
524288
65536
5
276
500
524288
65536
5
277
500
524288
65536
5
278
500
524288
65536
5
279
500
524288
65536
5
280
500
524288
65536
5
281
500
524288
65536
5
282
500
524288
65536
5
283
500
524288
65536
5
284
500
524288
65536
5
285
500
524288
65536
5
286
500
524288
65536
5
287
500
524288
65536
5
288
500
524288
65536
5
289
500
524288
65536
5
290
500
524288
65536
5
291
500
524288
65536
5
292
500
524288
65536
5
293
500
524288
65536
5
294
500
524288
65536
5
295
500
524288
65536
5
296
500
524288
65536
5
Submit
Back to Top