QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#427008#8650. Island Hoppingegypt_ioi2024_05#11 5ms4168kbC++20783b2024-06-01 05:22:372024-06-01 05:22:38

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

3 9
3
2
3
1
1
2
-1

output:

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

result:

wrong answer Wrong Answer [5]

Subtask #2:

score: 4
Accepted

Test #4:

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

input:

299 89401
79
213
242
286
192
244
69
227
99
233
29
244
272
277
54
83
67
149
72
276
163
278
196
226
216
239
60
268
225
293
101
113
43
159
23
219
63
222
89
213
38
59
97
134
18
101
167
232
160
186
212
225
78
161
143
147
6
226
122
154
45
209
35
183
55
165
159
257
32
241
199
265
116
151
21
250
157
287
119...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

ok 

Test #5:

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

input:

300 90000
15
220
17
130
10
200
153
269
43
147
12
36
32
50
178
218
14
181
3
174
79
208
6
261
44
260
9
295
1
199
229
288
2
53
256
266
66
236
159
295
190
280
144
201
185
265
60
136
254
264
39
270
55
163
176
188
59
238
95
149
186
276
7
277
111
113
65
106
193
287
6
162
202
287
249
275
26
127
223
231
86
1...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

ok 

Test #6:

score: 0
Accepted
time: 0ms
memory: 3904kb

input:

300 90000
171
201
20
209
47
131
17
250
208
284
27
83
25
61
119
196
40
157
167
196
62
100
209
256
163
184
65
297
157
193
99
161
4
272
198
267
29
158
2
261
36
237
57
171
73
214
119
246
7
189
148
252
6
155
32
152
19
214
112
162
85
298
28
44
151
221
182
188
116
176
21
111
136
201
88
280
80
270
9
278
47
...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

ok 

Test #7:

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

input:

300 90000
176
297
43
45
168
254
100
285
290
291
171
234
121
299
196
238
199
210
189
232
12
261
11
284
238
251
67
173
17
288
24
115
15
242
90
166
125
142
56
161
138
276
165
170
111
124
16
133
143
237
225
265
88
185
96
101
218
300
163
255
104
140
93
212
182
293
78
228
51
257
187
286
66
126
158
247
54
...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

ok 

Test #8:

score: 0
Accepted
time: 3ms
memory: 4148kb

input:

300 90000
96
162
28
282
19
239
107
161
160
165
259
271
34
90
114
169
78
188
92
146
219
226
100
258
61
140
129
174
44
251
196
283
39
199
125
154
3
127
24
300
73
205
77
171
130
193
20
68
37
280
162
195
118
267
2
298
135
141
109
278
206
250
104
195
290
292
7
291
115
123
56
102
25
220
57
193
17
45
47
29...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

ok 

Subtask #3:

score: 7
Accepted

Test #9:

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

input:

299 598
43
151
91
119
7
130
115
139
50
109
157
176
3
181
106
138
147
235
44
197
31
64
150
210
195
271
113
196
265
295
171
251
47
145
103
106
35
270
199
259
27
283
70
144
274
298
82
153
71
231
101
152
21
281
112
232
118
194
140
146
11
79
33
252
32
245
158
202
19
46
124
274
196
229
83
116
81
97
127
29...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

ok 

Test #10:

score: 0
Accepted
time: 3ms
memory: 3920kb

input:

300 600
26
95
33
74
65
160
25
186
30
158
147
251
152
226
62
178
55
226
96
228
61
256
135
234
103
172
165
203
40
109
107
176
78
272
215
299
92
110
50
108
112
200
56
229
48
282
68
258
4
205
1
80
163
259
296
300
115
253
5
31
30
86
199
202
2
236
97
130
297
170
252
264
120
121
189
266
96
242
15
241
80
15...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

ok 

Test #11:

score: 0
Accepted
time: 0ms
memory: 4144kb

input:

300 600
44
267
251
287
33
141
107
235
74
244
15
139
118
198
34
76
40
227
138
211
43
274
18
279
58
77
49
83
6
171
108
166
109
165
12
60
158
295
253
282
32
94
87
275
131
143
68
277
156
257
159
236
294
297
116
121
162
216
78
254
71
275
21
133
3
207
8
177
67
103
224
245
189
287
160
219
42
87
9
228
53
29...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

ok 

Test #12:

score: 0
Accepted
time: 5ms
memory: 3840kb

input:

300 600
30
281
176
216
7
51
130
241
137
179
275
297
3
144
59
157
118
274
35
148
33
141
37
85
171
279
43
217
136
152
105
161
195
199
41
299
47
240
47
139
146
171
279
291
193
204
260
271
150
285
154
283
242
258
94
97
126
186
1
112
237
253
115
120
11
297
81
282
10
295
185
256
12
163
284
292
134
262
67
...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

ok 

Test #13:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

300 600
75
115
203
228
242
298
122
269
165
260
66
295
35
89
36
125
179
281
190
230
64
148
18
218
80
84
22
158
103
248
45
208
21
91
12
272
72
228
258
292
17
85
14
248
119
298
49
279
119
203
33
252
67
91
155
296
229
266
193
262
83
135
115
181
26
242
56
123
7
106
8
45
220
293
132
236
94
269
66
155
173
...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

ok 

Test #14:

score: 0
Accepted
time: 0ms
memory: 3908kb

input:

300 600
232
264
70
250
26
223
187
296
129
240
145
166
177
274
117
214
162
238
190
212
93
242
20
112
54
258
67
147
135
200
83
155
169
201
116
182
233
245
12
183
180
225
63
275
67
77
95
107
33
168
3
98
176
226
36
99
118
214
237
273
102
202
65
192
25
280
101
281
37
61
28
207
35
256
46
62
46
163
185
241...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

ok 

Subtask #4:

score: 0
Wrong Answer

Test #15:

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

input:

299 89401
29
35
153
230
166
181
54
266
65
159
75
176
166
241
9
83
8
250
88
141
19
68
193
224
154
215
26
228
73
221
271
50
231
239
44
107
11
68
265
269
264
275
83
289
111
234
179
262
41
147
14
191
116
204
177
188
1
122
80
110
263
295
48
288
86
185
43
120
1
87
61
91
143
239
90
164
67
111
187
260
25
15...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

wrong answer Wrong Answer [7]

Subtask #5:

score: 0
Wrong Answer

Test #23:

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

input:

299 897
140
269
39
121
67
86
214
262
234
244
122
146
174
240
227
237
206
281
65
275
41
254
211
272
117
199
51
165
152
207
195
235
28
225
143
231
127
156
64
166
144
194
119
196
201
298
271
299
109
255
88
224
109
292
17
103
210
267
36
294
213
297
42
162
197
257
87
145
186
259
30
287
98
118
41
231
2
87...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

wrong answer Wrong Answer [7]

Subtask #6:

score: 0
Wrong Answer

Test #32:

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

input:

300 90000
133
179
82
47
65
165
266
283
29
40
24
35
28
234
86
199
186
299
109
231
29
221
105
112
128
277
117
126
108
231
247
118
131
12
234
7
94
210
141
181
160
197
26
208
219
235
6
268
40
116
22
226
138
184
7
234
5
11
80
101
45
234
102
236
67
282
111
78
6
282
148
248
70
204
119
138
62
162
5
25
6
132...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

wrong answer Wrong Answer [5]

Subtask #7:

score: 0
Wrong Answer

Test #58:

score: 0
Wrong Answer
time: 4ms
memory: 3828kb

input:

300 900
201
228
88
262
97
104
35
183
96
98
70
138
60
141
23
80
46
51
76
171
43
180
69
203
141
173
95
168
159
166
264
89
196
233
119
293
32
191
176
30
235
261
152
230
8
80
67
247
148
174
31
225
170
116
107
105
244
263
106
176
26
38
19
108
77
182
61
35
4
61
43
299
109
271
31
174
51
74
76
147
197
157
2...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

wrong answer Wrong Answer [5]

Subtask #8:

score: 0
Wrong Answer

Test #84:

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

input:

299 598
86
94
79
228
49
166
124
138
257
262
51
129
214
55
20
206
50
64
177
262
200
209
238
150
66
223
15
92
14
92
38
68
229
254
175
263
193
31
8
28
148
33
45
197
234
160
32
105
231
48
175
186
126
180
20
189
142
196
127
172
91
193
24
105
148
221
246
203
150
173
62
159
109
69
16
68
54
144
129
6
207
44...

output:

1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
10 2
11 1
11 2
12 1
12 2
13 1
13 2
14 1
14 2
15 1
15 2
16 1
16 2
17 1
17 2
18 1
18 2
19 1
19 2
20 1
20 2
21 1
21 2
22 1
22 2
23 1
23 2
24 1
24 2
25 1
25 2
26 1
26 2
27 1
27 2
28 1
28 2
29 1
29 2
30 1
30 2
31 1
31 2
32 1
32 ...

result:

wrong answer Wrong Answer [5]