QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#430459#8650. Island Hoppingegypt_ioi2024_04#13 10ms8512kbC++202.2kb2024-06-03 20:39:522024-06-03 20:39:53

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 2
Accepted

Test #1:

score: 2
Accepted
time: 0ms
memory: 7972kb

input:

3 9
3
1
0
2
3
2
0

output:

1 1
3 1
-1 3
1 2
2 1
3 2
-2 3
0 0

result:

ok 

Test #2:

score: 2
Accepted
time: 1ms
memory: 8152kb

input:

3 9
3
1
0
2
3
2
0

output:

1 1
3 1
-1 3
1 2
2 1
3 2
-2 3
0 0

result:

ok 

Test #3:

score: 2
Accepted
time: 1ms
memory: 8104kb

input:

3 9
2
1
0
3
2
3
0

output:

1 1
2 1
-1 2
1 2
3 1
2 2
-2 3
0 0

result:

ok 

Subtask #2:

score: 4
Accepted

Test #4:

score: 4
Accepted
time: 4ms
memory: 8376kb

input:

299 89401
79
1
0
213
1
0
242
2
0
286
2
0
192
3
0
244
3
0
69
4
0
227
4
0
99
5
0
233
5
0
29
6
0
244
6
0
272
7
0
277
7
0
54
8
0
83
8
0
67
9
0
149
9
0
72
10
0
276
10
0
163
11
0
278
11
0
196
12
0
226
12
0
216
13
0
239
13
0
60
14
0
268
14
0
225
15
0
293
15
0
101
16
0
113
16
0
43
17
0
159
17
0
23
18
0
219
...

output:

1 1
79 1
-1 79
1 2
213 1
-1 213
2 1
242 1
-2 242
2 2
286 1
-2 286
3 1
192 1
-3 192
3 2
244 1
-3 244
4 1
69 1
-4 69
4 2
227 1
-4 227
5 1
99 1
-5 99
5 2
233 1
-5 233
6 1
29 1
-6 29
6 2
244 2
-6 244
7 1
272 1
-7 272
7 2
277 1
-7 277
8 1
54 1
-8 54
8 2
83 1
-8 83
9 1
67 1
-9 67
9 2
149 1
-9 149
10 1
72 ...

result:

ok 

Test #5:

score: 4
Accepted
time: 6ms
memory: 8368kb

input:

300 90000
15
1
0
220
1
0
17
2
0
130
2
0
10
3
0
200
3
0
153
4
0
269
4
0
43
5
0
147
5
0
12
6
0
36
6
0
32
7
0
50
7
0
178
8
0
218
8
0
14
9
0
181
9
0
174
10
0
79
11
0
208
11
0
261
12
0
44
13
0
260
13
0
295
14
0
199
15
0
229
16
0
288
16
0
53
17
0
256
18
0
266
18
0
66
19
0
236
19
0
159
20
0
295
20
0
190
21...

output:

1 1
15 1
-1 15
1 2
220 1
-1 220
2 1
17 1
-2 17
2 2
130 1
-2 130
3 1
10 1
-3 10
3 2
200 1
-3 200
4 1
153 1
-4 153
4 2
269 1
-4 269
5 1
43 1
-5 43
5 2
147 1
-5 147
6 1
12 1
-6 12
6 2
36 1
-6 36
7 1
32 1
-7 32
7 2
50 1
-7 50
8 1
178 1
-8 178
8 2
218 1
-8 218
9 1
14 1
-9 14
9 2
181 1
-9 181
10 2
174 1
-...

result:

ok 

Test #6:

score: 4
Accepted
time: 0ms
memory: 8448kb

input:

300 90000
171
1
0
201
1
0
20
2
0
209
2
0
47
3
0
131
3
0
17
4
0
250
4
0
208
5
0
284
5
0
27
6
0
83
6
0
25
7
0
61
7
0
119
8
0
196
8
0
40
9
0
157
9
0
167
10
0
196
10
0
62
11
0
100
11
0
209
12
0
256
12
0
163
13
0
184
13
0
65
14
0
297
14
0
157
15
0
193
15
0
99
16
0
161
16
0
272
17
0
198
18
0
267
18
0
29
1...

output:

1 1
171 1
-1 171
1 2
201 1
-1 201
2 1
20 1
-2 20
2 2
209 1
-2 209
3 1
47 1
-3 47
3 2
131 1
-3 131
4 1
17 1
-4 17
4 2
250 1
-4 250
5 1
208 1
-5 208
5 2
284 1
-5 284
6 1
27 1
-6 27
6 2
83 1
-6 83
7 1
25 1
-7 25
7 2
61 1
-7 61
8 1
119 1
-8 119
8 2
196 1
-8 196
9 1
40 1
-9 40
9 2
157 1
-9 157
10 1
167 1...

result:

ok 

Test #7:

score: 4
Accepted
time: 0ms
memory: 8460kb

input:

300 90000
176
1
0
297
1
0
43
2
0
45
2
0
168
3
0
254
3
0
100
4
0
285
4
0
290
5
0
291
5
0
171
6
0
234
6
0
121
7
0
299
7
0
196
8
0
238
8
0
199
9
0
210
9
0
189
10
0
232
10
0
12
11
0
261
11
0
284
12
0
238
13
0
251
13
0
67
14
0
173
14
0
17
15
0
288
15
0
24
16
0
115
16
0
242
17
0
90
18
0
166
18
0
125
19
0
...

output:

1 1
176 1
-1 176
1 2
297 1
-1 297
2 1
43 1
-2 43
2 2
45 1
-2 45
3 1
168 1
-3 168
3 2
254 1
-3 254
4 1
100 1
-4 100
4 2
285 1
-4 285
5 1
290 1
-5 290
5 2
291 1
-5 291
6 1
171 1
-6 171
6 2
234 1
-6 234
7 1
121 1
-7 121
7 2
299 1
-7 299
8 1
196 1
-8 196
8 2
238 1
-8 238
9 1
199 1
-9 199
9 2
210 1
-9 21...

result:

ok 

Test #8:

score: 4
Accepted
time: 0ms
memory: 8328kb

input:

300 90000
96
1
0
162
1
0
28
2
0
282
2
0
19
3
0
239
3
0
107
4
0
161
4
0
160
5
0
165
5
0
259
6
0
271
6
0
34
7
0
90
7
0
114
8
0
169
8
0
78
9
0
188
9
0
92
10
0
146
10
0
219
11
0
226
11
0
100
12
0
258
12
0
61
13
0
140
13
0
129
14
0
174
14
0
44
15
0
251
15
0
196
16
0
283
16
0
39
17
0
199
17
0
125
18
0
154...

output:

1 1
96 1
-1 96
1 2
162 1
-1 162
2 1
28 1
-2 28
2 2
282 1
-2 282
3 1
19 1
-3 19
3 2
239 1
-3 239
4 1
107 1
-4 107
4 2
161 1
-4 161
5 1
160 1
-5 160
5 2
165 1
-5 165
6 1
259 1
-6 259
6 2
271 1
-6 271
7 1
34 1
-7 34
7 2
90 1
-7 90
8 1
114 1
-8 114
8 2
169 1
-8 169
9 1
78 1
-9 78
9 2
188 1
-9 188
10 1
9...

result:

ok 

Subtask #3:

score: 7
Accepted

Test #9:

score: 7
Accepted
time: 0ms
memory: 8364kb

input:

299 598
43
1
0
151
1
0
91
2
0
119
2
0
7
3
0
130
3
0
115
4
0
139
4
0
50
5
0
109
5
0
157
6
0
176
6
0
181
7
0
106
8
0
138
8
0
147
9
0
235
9
0
44
10
0
197
10
0
31
11
0
64
11
0
150
12
0
210
12
0
195
13
0
271
13
0
113
14
0
196
14
0
265
15
0
295
15
0
171
16
0
251
16
0
47
17
0
145
17
0
103
18
0
106
18
0
35
...

output:

1 1
43 1
-1 43
1 2
151 1
-1 151
2 1
91 1
-2 91
2 2
119 1
-2 119
3 1
7 1
-3 7
3 2
130 1
-3 130
4 1
115 1
-4 115
4 2
139 1
-4 139
5 1
50 1
-5 50
5 2
109 1
-5 109
6 1
157 1
-6 157
6 2
176 1
-6 176
7 2
181 1
-7 181
8 1
106 1
-8 106
8 2
138 1
-8 138
9 1
147 1
-9 147
9 2
235 1
-9 235
10 1
44 1
-10 44
10 2...

result:

ok 

Test #10:

score: 7
Accepted
time: 2ms
memory: 8320kb

input:

300 600
26
1
0
95
1
0
33
2
0
74
2
0
65
3
0
160
3
0
25
4
0
186
4
0
30
5
0
158
5
0
147
6
0
251
6
0
152
7
0
226
7
0
62
8
0
178
8
0
55
9
0
226
9
0
96
10
0
228
10
0
61
11
0
256
11
0
135
12
0
234
12
0
103
13
0
172
13
0
165
14
0
203
14
0
40
15
0
109
15
0
107
16
0
176
16
0
78
17
0
272
17
0
215
18
0
299
18
0...

output:

1 1
26 1
-1 26
1 2
95 1
-1 95
2 1
33 1
-2 33
2 2
74 1
-2 74
3 1
65 1
-3 65
3 2
160 1
-3 160
4 1
25 1
-4 25
4 2
186 1
-4 186
5 1
30 1
-5 30
5 2
158 1
-5 158
6 1
147 1
-6 147
6 2
251 1
-6 251
7 1
152 1
-7 152
7 2
226 1
-7 226
8 1
62 1
-8 62
8 2
178 1
-8 178
9 1
55 1
-9 55
9 2
226 2
-9 226
10 1
96 1
-1...

result:

ok 

Test #11:

score: 7
Accepted
time: 2ms
memory: 8460kb

input:

300 600
44
1
0
267
1
0
251
2
0
287
2
0
33
3
0
141
3
0
107
4
0
235
4
0
74
5
0
244
5
0
15
6
0
139
6
0
118
7
0
198
7
0
34
8
0
76
8
0
40
9
0
227
9
0
138
10
0
211
10
0
43
11
0
274
11
0
18
12
0
279
12
0
58
13
0
77
13
0
49
14
0
83
14
0
171
15
0
108
16
0
166
16
0
109
17
0
165
17
0
60
18
0
158
19
0
295
19
0
...

output:

1 1
44 1
-1 44
1 2
267 1
-1 267
2 1
251 1
-2 251
2 2
287 1
-2 287
3 1
33 1
-3 33
3 2
141 1
-3 141
4 1
107 1
-4 107
4 2
235 1
-4 235
5 1
74 1
-5 74
5 2
244 1
-5 244
6 1
15 1
-6 15
6 2
139 1
-6 139
7 1
118 1
-7 118
7 2
198 1
-7 198
8 1
34 1
-8 34
8 2
76 1
-8 76
9 1
40 1
-9 40
9 2
227 1
-9 227
10 1
138...

result:

ok 

Test #12:

score: 7
Accepted
time: 0ms
memory: 8512kb

input:

300 600
30
1
0
281
1
0
176
2
0
216
2
0
7
3
0
51
3
0
130
4
0
241
4
0
137
5
0
179
5
0
275
6
0
297
6
0
144
7
0
59
8
0
157
8
0
118
9
0
274
9
0
35
10
0
148
10
0
33
11
0
141
11
0
37
12
0
85
12
0
171
13
0
279
13
0
43
14
0
217
14
0
136
15
0
152
15
0
105
16
0
161
16
0
195
17
0
199
17
0
41
18
0
299
18
0
47
19...

output:

1 1
30 1
-1 30
1 2
281 1
-1 281
2 1
176 1
-2 176
2 2
216 1
-2 216
3 1
7 1
-3 7
3 2
51 1
-3 51
4 1
130 1
-4 130
4 2
241 1
-4 241
5 1
137 1
-5 137
5 2
179 1
-5 179
6 1
275 1
-6 275
6 2
297 1
-6 297
7 2
144 1
-7 144
8 1
59 1
-8 59
8 2
157 1
-8 157
9 1
118 1
-9 118
9 2
274 1
-9 274
10 1
35 1
-10 35
10 2...

result:

ok 

Test #13:

score: 7
Accepted
time: 6ms
memory: 8460kb

input:

300 600
75
1
0
115
1
0
203
2
0
228
2
0
242
3
0
298
3
0
122
4
0
269
4
0
165
5
0
260
5
0
66
6
0
295
6
0
35
7
0
89
7
0
36
8
0
125
8
0
179
9
0
281
9
0
190
10
0
230
10
0
64
11
0
148
11
0
18
12
0
218
12
0
80
13
0
84
13
0
22
14
0
158
14
0
103
15
0
248
15
0
45
16
0
208
16
0
21
17
0
91
17
0
272
18
0
72
19
0
...

output:

1 1
75 1
-1 75
1 2
115 1
-1 115
2 1
203 1
-2 203
2 2
228 1
-2 228
3 1
242 1
-3 242
3 2
298 1
-3 298
4 1
122 1
-4 122
4 2
269 1
-4 269
5 1
165 1
-5 165
5 2
260 1
-5 260
6 1
66 1
-6 66
6 2
295 1
-6 295
7 1
35 1
-7 35
7 2
89 1
-7 89
8 1
36 1
-8 36
8 2
125 1
-8 125
9 1
179 1
-9 179
9 2
281 1
-9 281
10 1...

result:

ok 

Test #14:

score: 7
Accepted
time: 3ms
memory: 8504kb

input:

300 600
232
1
0
264
1
0
70
2
0
250
2
0
26
3
0
223
3
0
187
4
0
296
4
0
129
5
0
240
5
0
145
6
0
166
6
0
177
7
0
274
7
0
117
8
0
214
8
0
162
9
0
238
9
0
190
10
0
212
10
0
93
11
0
242
11
0
20
12
0
112
12
0
54
13
0
258
13
0
67
14
0
147
14
0
135
15
0
200
15
0
83
16
0
155
16
0
169
17
0
201
17
0
116
18
0
18...

output:

1 1
232 1
-1 232
1 2
264 1
-1 264
2 1
70 1
-2 70
2 2
250 1
-2 250
3 1
26 1
-3 26
3 2
223 1
-3 223
4 1
187 1
-4 187
4 2
296 1
-4 296
5 1
129 1
-5 129
5 2
240 1
-5 240
6 1
145 1
-6 145
6 2
166 1
-6 166
7 1
177 1
-7 177
7 2
274 1
-7 274
8 1
117 1
-8 117
8 2
214 1
-8 214
9 1
162 1
-9 162
9 2
238 1
-9 23...

result:

ok 

Subtask #4:

score: 0
Wrong Answer

Test #15:

score: 0
Wrong Answer
time: 1ms
memory: 8392kb

input:

299 89401
29
1
0
35
1
0
153
2
0
230
2
0
166
3
0
181
3
0
54
4
0
266
4
0
65
5
0
159
5
0
75
6
0
176
6
0
166
7
0
241
7
0
9
8
0
83
8
0
250
9
0
88
10
0
141
10
0
19
11
0
68
19
193
12
0
224
12
0
154
13
0
215
13
0
26
14
0
228
14
0
73
15
0
221
15
0
271
16
0
50
53
231
17
0
239
17
0
44
18
0
107
18
0
68
0
265
20...

output:

1 1
29 1
-1 29
1 2
35 1
-1 35
2 1
153 1
-2 153
2 2
230 1
-2 230
3 1
166 1
-3 166
3 2
181 1
-3 181
4 1
54 1
-4 54
4 2
266 1
-4 266
5 1
65 1
-5 65
5 2
159 1
-5 159
6 1
75 1
-6 75
6 2
176 1
-6 176
7 1
166 2
-7 166
7 2
241 1
-7 241
8 1
9 1
-8 9
8 2
83 1
-8 83
9 2
250 1
-9 250
10 1
88 1
-10 88
10 2
141 1...

result:

wrong answer Wrong Answer [1]

Subtask #5:

score: 0
Wrong Answer

Test #23:

score: 0
Wrong Answer
time: 10ms
memory: 8500kb

input:

299 897
140
1
0
269
1
0
39
2
0
121
2
0
67
3
0
86
3
0
214
4
0
262
4
0
234
5
0
244
5
0
122
6
0
146
6
0
174
7
0
240
7
0
227
8
0
237
8
0
206
9
0
281
9
0
65
10
0
275
10
0
41
11
0
254
11
0
211
12
0
272
12
0
117
13
0
199
13
0
51
14
0
165
14
0
152
15
0
207
15
0
195
16
0
235
16
0
28
17
0
225
17
0
143
18
0
23...

output:

1 1
140 1
-1 140
1 2
269 1
-1 269
2 1
39 1
-2 39
2 2
121 1
-2 121
3 1
67 1
-3 67
3 2
86 1
-3 86
4 1
214 1
-4 214
4 2
262 1
-4 262
5 1
234 1
-5 234
5 2
244 1
-5 244
6 1
122 1
-6 122
6 2
146 1
-6 146
7 1
174 1
-7 174
7 2
240 1
-7 240
8 1
227 1
-8 227
8 2
237 1
-8 237
9 1
206 1
-9 206
9 2
281 1
-9 281
...

result:

wrong answer Wrong Answer [1]

Subtask #6:

score: 0
Wrong Answer

Test #32:

score: 0
Wrong Answer
time: 7ms
memory: 8508kb

input:

300 90000
133
1
0
179
1
0
82
2
0
47
82
65
3
0
165
65
266
4
0
283
4
0
29
5
0
40
5
0
24
6
0
35
6
0
28
7
0
234
7
0
86
8
0
199
86
186
9
0
299
54
109
10
0
231
10
0
29
11
0
221
11
0
105
12
0
112
12
0
128
13
0
277
13
0
117
14
0
126
14
0
108
15
0
231
108
247
16
0
118
77
131
12
234
18
0
7
94
19
0
210
19
0
14...

output:

1 1
133 1
-1 133
1 2
179 1
-1 179
2 1
82 1
-2 82
2 2
47 1
3 1
65 1
-3 65
3 2
165 1
4 1
266 1
-4 266
4 2
283 1
-4 283
5 1
29 1
-5 29
5 2
40 1
-5 40
6 1
24 1
-6 24
6 2
35 1
-6 35
7 1
28 1
-7 28
7 2
234 1
-7 234
8 1
86 1
-8 86
8 2
199 1
9 1
186 1
-9 186
9 2
299 1
10 1
109 1
-10 109
10 2
231 1
-10 231
1...

result:

wrong answer Wrong Answer [1]

Subtask #7:

score: 0
Wrong Answer

Test #58:

score: 0
Wrong Answer
time: 3ms
memory: 8460kb

input:

300 900
201
1
0
228
1
0
88
2
0
262
88
97
3
0
104
3
0
35
4
0
183
4
0
96
5
0
98
5
0
70
6
0
138
6
0
60
7
0
141
7
0
23
8
0
80
8
0
46
9
0
51
39
76
10
0
171
10
0
43
11
0
180
11
0
69
12
0
203
12
0
141
13
0
173
13
0
95
14
0
168
91
159
15
0
166
132
264
16
0
89
110
196
17
0
233
17
0
119
18
0
293
18
0
32
19
0
...

output:

1 1
201 1
-1 201
1 2
228 1
-1 228
2 1
88 1
-2 88
2 2
262 1
3 1
97 1
-3 97
3 2
104 1
-3 104
4 1
35 1
-4 35
4 2
183 1
-4 183
5 1
96 1
-5 96
5 2
98 1
-5 98
6 1
70 1
-6 70
6 2
138 1
-6 138
7 1
60 1
-7 60
7 2
141 1
-7 141
8 1
23 1
-8 23
8 2
80 1
-8 80
9 1
46 1
-9 46
9 2
51 1
10 1
76 1
-10 76
10 2
171 1
-...

result:

wrong answer Wrong Answer [1]

Subtask #8:

score: 0
Wrong Answer

Test #84:

score: 0
Wrong Answer
time: 0ms
memory: 8452kb

input:

299 598
86
1
0
94
1
0
79
2
0
228
2
0
49
3
0
166
3
0
124
4
0
138
83
257
5
0
262
5
0
51
6
0
129
6
0
214
7
0
55
51
20
8
0
206
8
0
50
9
0
64
9
0
177
10
0
262
77
200
11
0
209
11
0
238
12
0
150
35
66
13
0
223
13
0
15
14
0
92
15
92
0
38
16
0
68
38
229
17
0
254
187
175
18
0
263
18
0
193
19
0
31
91
28
20
0
1...

output:

1 1
86 1
-1 86
1 2
94 1
-1 94
2 1
79 1
-2 79
2 2
228 1
-2 228
3 1
49 1
-3 49
3 2
166 1
-3 166
4 1
124 1
-4 124
4 2
138 1
5 1
257 1
-5 257
5 2
262 1
-5 262
6 1
51 1
-6 51
6 2
129 1
-6 129
7 1
214 1
-7 214
7 2
55 1
8 1
20 1
-8 20
8 2
206 1
-8 206
9 1
50 1
-9 50
9 2
64 1
-9 64
10 1
177 1
-10 177
10 2
2...

result:

wrong answer Wrong Answer [3]