QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#375791#4088. 총 쏘기hotboy27039 150ms5620kbC++142.2kb2024-04-03 15:55:382024-04-03 15:55:39

Judging History

你现在查看的是最新测评结果

  • [2024-04-03 15:55:39]
  • 评测
  • 测评结果:9
  • 用时:150ms
  • 内存:5620kb
  • [2024-04-03 15:55:38]
  • 提交

answer

#include<bits/stdc++.h>
using ll = long long;
using namespace std;
#define pll pair <ll,ll>
#define fi first
#define se second
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1)
#define MASK(i) (1LL << (i))
#define MP make_pair
namespace{
    const ll MAXN = 1e5;
    ll n;
    ll a[MAXN+100];
    ll b[MAXN+100];
    ll rev[MAXN+100];
    vector <pair <int,int> > ans;
    void solve(){
        set <ll> s;
        for (ll i = 1;i <= n;i ++)s.insert(i);
        for (ll i = 1;i <= n;i ++){b[i] = n + 1 - a[i];rev[b[i]] = i;}
        vector <ll> lds;
        ll inv[MAXN+100];
        while (sz(s)){
            vector <pll> tr;
            ll max1 = -1;
            for (auto x:s){
                if (a[x]>max1){
                    max1 = a[x];
                    ll max2 = max1;
                    for (auto y:s){
                        if (a[y] > max2){
                            max2 = a[y];
                            tr.push_back({x,y});
                        }
                    }
                }

            }
            pll best;
            ll cur_best = -1;
            ll single=*s.begin();
            for (auto i:s){
                inv[i] = 0;
                for (auto j:s){
                    ll l = min(i,j),r = max(i,j);
                    if (a[l] > a[r])inv[i]++;
                }
            }
            for (auto x:tr){
                ll sus = inv[x.fi] + inv[x.se] - (a[x.fi] > a[x.se]);
                if (sus > cur_best){
                    cur_best = sus;
                    best = x;
                }
            }
            for (auto x:s){
                if (inv[x] > inv[single])single = x;
            }
            if (cur_best != -1){
                s.erase(best.fi);
                s.erase(best.se);
                ans.push_back(MP(a[best.fi],a[best.se]));
            }
            else{
                s.erase(single);
                ans.push_back(MP(a[single],n+1));
            }
        }
//        sort(ans.begin(),ans.end());
    }
}
std::vector<std::pair<int, int>> min_shooting_buildings(std::vector<int> H){
    n = sz(H);
    for (ll i = 1;i <= n;i ++)a[i] = H[i-1];
	solve();
	return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Time Limit Exceeded

Test #1:

score: 17
Accepted
time: 1ms
memory: 4568kb

input:

8
4 3 8 2 1 7 6 5

output:

4
4 8
3 7
2 6
1 5

result:

ok Correct

Test #2:

score: 0
Accepted
time: 1ms
memory: 4856kb

input:

16
12 16 11 15 10 9 8 4 14 13 7 2 6 5 3 1

output:

10
12 16
11 15
10 14
9 13
8 17
4 7
2 6
5 17
3 17
1 17

result:

ok Correct

Test #3:

score: 0
Accepted
time: 1ms
memory: 4592kb

input:

16
16 13 10 7 6 15 14 12 5 11 4 9 3 8 1 2

output:

9
16 17
13 15
10 14
7 12
6 11
5 9
4 8
3 17
1 2

result:

ok Correct

Test #4:

score: 0
Accepted
time: 1ms
memory: 4524kb

input:

16
16 13 10 15 8 14 12 7 4 11 9 6 1 5 3 2

output:

10
16 17
13 15
10 14
8 12
7 11
4 9
6 17
1 5
3 17
2 17

result:

ok Correct

Test #5:

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

input:

16
14 13 12 11 16 15 8 10 6 9 4 7 3 1 5 2

output:

9
14 16
13 15
12 17
11 17
8 10
6 9
4 7
3 5
1 2

result:

ok Correct

Test #6:

score: 0
Accepted
time: 1ms
memory: 4560kb

input:

16
14 13 16 11 9 15 12 6 5 10 8 7 2 1 4 3

output:

8
14 16
13 15
11 12
9 10
6 8
5 7
2 4
1 3

result:

ok Correct

Test #7:

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

input:

16
15 16 14 12 11 9 7 5 4 13 2 10 1 8 6 3

output:

10
15 16
14 17
12 13
11 17
9 10
7 8
5 6
4 17
2 3
1 17

result:

ok Correct

Test #8:

score: 0
Accepted
time: 83ms
memory: 4832kb

input:

495
492 491 487 481 495 494 493 480 490 478 489 488 477 486 485 475 472 484 483 471 468 482 479 466 465 463 476 461 460 459 474 457 473 455 454 470 469 453 452 467 450 449 464 462 448 447 458 456 443 451 446 442 445 437 436 435 434 433 429 444 427 426 441 440 439 424 423 438 421 419 416 432 413 431 ...

output:

250
492 495
491 494
487 493
481 490
480 489
478 488
477 486
485 496
475 484
472 483
471 482
468 479
466 476
465 474
463 473
461 470
460 469
459 467
457 464
455 462
454 458
453 456
452 496
450 451
449 496
448 496
447 496
443 446
442 445
437 444
436 441
435 440
434 439
433 438
429 432
427 431
426 430
...

result:

ok Correct

Test #9:

score: 0
Accepted
time: 87ms
memory: 4544kb

input:

496
493 491 486 496 481 495 494 492 490 489 473 488 487 472 469 468 485 484 483 464 482 480 463 479 478 477 460 458 476 475 457 456 474 471 455 454 470 453 452 467 449 448 447 446 466 437 465 436 433 432 430 428 462 426 461 425 424 421 420 419 459 417 416 451 410 450 409 408 407 445 405 444 443 442 ...

output:

262
493 496
491 495
486 494
481 492
490 497
489 497
473 488
487 497
472 485
469 484
468 483
464 482
480 497
463 479
478 497
477 497
460 476
458 475
457 474
456 471
455 470
454 467
453 466
452 465
449 462
448 461
447 459
446 451
437 450
436 445
433 444
432 443
430 442
428 441
426 440
425 439
424 438
...

result:

ok Correct

Test #10:

score: 0
Accepted
time: 83ms
memory: 4596kb

input:

497
496 492 490 489 497 495 494 493 488 486 485 484 480 478 491 487 475 483 474 482 471 468 465 464 460 459 481 458 457 456 479 477 455 453 476 473 450 444 443 440 472 439 470 469 435 433 467 432 430 466 429 463 462 428 461 425 420 419 454 418 452 451 416 449 415 413 412 448 409 402 401 400 447 399 ...

output:

259
496 497
492 495
490 494
489 493
488 491
486 487
485 498
484 498
480 483
478 482
475 481
474 479
471 477
468 476
465 473
464 472
460 470
459 469
458 467
457 466
456 463
455 462
453 461
450 454
444 452
443 451
440 449
439 448
435 447
433 446
432 445
430 442
429 441
428 438
425 437
420 436
419 434
...

result:

ok Correct

Test #11:

score: 0
Accepted
time: 92ms
memory: 4580kb

input:

498
496 495 494 493 498 497 489 492 491 488 485 490 487 482 486 484 481 479 478 475 483 474 480 477 476 473 471 464 472 462 470 469 459 458 456 468 467 454 466 453 465 450 448 446 463 461 460 445 440 457 455 437 452 434 451 449 433 432 431 428 427 425 447 444 443 442 422 441 419 439 438 436 418 435 ...

output:

272
496 498
495 497
494 499
493 499
489 492
491 499
488 490
485 487
482 486
484 499
481 483
479 480
478 499
475 477
474 476
473 499
471 472
464 470
462 469
459 468
458 467
456 466
454 465
453 463
450 461
448 460
446 457
445 455
440 452
437 451
434 449
433 447
432 444
431 443
428 442
427 441
425 439
...

result:

ok Correct

Test #12:

score: 0
Accepted
time: 86ms
memory: 4612kb

input:

499
498 496 492 499 497 495 494 493 491 489 486 484 481 490 488 487 478 485 483 474 465 482 464 480 463 461 460 479 477 459 476 456 475 455 473 472 471 470 453 469 452 451 448 447 468 467 446 445 466 439 434 433 462 458 457 454 450 449 432 444 443 430 442 441 428 440 438 437 427 422 436 421 420 418 ...

output:

266
498 499
496 497
492 495
494 500
493 500
491 500
489 490
486 488
484 487
481 485
478 483
474 482
465 480
464 479
463 477
461 476
460 475
459 473
456 472
455 471
470 500
453 469
452 468
451 467
448 466
447 462
446 458
445 457
439 454
434 450
433 449
432 444
443 500
430 442
441 500
428 440
438 500
...

result:

ok Correct

Test #13:

score: 0
Accepted
time: 84ms
memory: 4596kb

input:

500
499 500 495 490 498 489 497 496 488 486 484 482 478 477 476 475 494 493 470 492 491 469 468 467 487 463 458 485 483 481 450 444 442 480 479 441 474 473 472 440 439 438 437 471 436 435 466 434 430 465 429 428 425 424 423 464 422 421 462 461 460 459 419 417 415 457 413 456 455 454 453 452 411 410 ...

output:

254
499 500
495 498
490 497
489 496
488 494
486 493
484 492
482 491
478 487
477 485
476 483
475 481
470 480
469 479
468 474
467 473
463 472
458 471
450 466
444 465
442 464
441 462
440 461
439 460
438 459
437 457
436 456
435 455
434 454
430 453
429 452
428 451
425 449
424 448
423 447
422 446
421 445
...

result:

ok Correct

Test #14:

score: -17
Time Limit Exceeded

input:

7495
7495 7490 7488 7486 7494 7481 7480 7478 7477 7475 7463 7460 7459 7493 7492 7458 7491 7489 7487 7485 7457 7455 7484 7483 7454 7453 7452 7450 7448 7482 7444 7442 7440 7435 7479 7431 7476 7474 7426 7473 7423 7422 7421 7418 7472 7471 7470 7469 7468 7467 7414 7413 7411 7409 7408 7405 7466 7465 7403 ...

output:

Unauthorized output

result:


Subtask #2:

score: 0
Time Limit Exceeded

Test #26:

score: 12
Accepted
time: 1ms
memory: 4512kb

input:

8
5 6 7 1 2 8 3 4

output:

4
5 6
7 8
1 2
3 4

result:

ok Correct

Test #27:

score: 0
Accepted
time: 1ms
memory: 4560kb

input:

16
2 4 5 1 9 10 3 6 14 7 8 11 12 16 13 15

output:

8
9 14
4 10
5 16
2 3
1 6
7 8
11 12
13 15

result:

ok Correct

Test #28:

score: 0
Accepted
time: 1ms
memory: 4604kb

input:

16
2 3 1 8 12 4 5 6 7 14 15 9 10 16 11 13

output:

8
8 12
14 15
2 16
3 4
1 5
6 7
9 10
11 13

result:

ok Correct

Test #29:

score: 0
Accepted
time: 1ms
memory: 4852kb

input:

16
3 5 1 6 8 9 2 11 12 4 7 14 15 10 16 13

output:

8
5 8
9 11
3 12
6 14
15 16
1 2
4 7
10 13

result:

ok Correct

Test #30:

score: 0
Accepted
time: 1ms
memory: 4588kb

input:

16
1 7 2 3 9 11 4 5 6 12 15 8 10 16 13 14

output:

8
7 11
9 15
12 16
1 2
3 4
5 6
8 10
13 14

result:

ok Correct

Test #31:

score: 0
Accepted
time: 1ms
memory: 4552kb

input:

16
6 7 8 1 9 2 3 4 11 12 5 10 13 14 15 16

output:

8
6 7
8 9
11 12
1 2
3 4
5 10
13 14
15 16

result:

ok Correct

Test #32:

score: 0
Accepted
time: 1ms
memory: 4604kb

input:

16
1 6 2 7 8 9 10 13 3 4 5 11 14 12 16 15

output:

8
6 13
7 8
9 10
14 16
1 2
3 4
5 11
12 15

result:

ok Correct

Test #33:

score: 0
Accepted
time: 141ms
memory: 5132kb

input:

495
5 6 7 9 10 1 2 12 3 13 15 17 18 19 20 24 4 8 11 26 27 29 30 31 33 14 16 21 34 35 39 22 40 43 23 44 25 28 32 47 36 37 48 38 53 56 41 57 42 45 46 49 50 60 62 63 65 51 52 54 55 58 59 69 71 61 72 64 66 74 77 67 68 80 70 81 84 87 88 89 90 92 73 96 75 97 98 76 99 102 78 79 82 83 105 106 85 86 91 110 9...

output:

248
227 228
223 225
229 230
231 232
235 236
219 237
195 196
204 239
240 263
242 259
205 206
208 211
212 243
256 260
267 268
200 209
250 251
252 253
254 265
197 198
245 248
269 272
318 319
270 326
275 340
315 418
320 419
420 421
276 277
312 322
328 341
343 422
423 429
183 297
150 299
278 279
309 329
...

result:

ok Correct

Test #34:

score: 0
Accepted
time: 150ms
memory: 5104kb

input:

496
1 5 6 8 9 11 13 2 3 14 4 7 16 10 12 15 19 21 24 26 29 31 17 32 18 33 20 35 39 22 41 44 23 47 25 48 27 28 30 51 34 54 36 37 38 40 42 55 43 45 56 58 46 49 50 52 59 60 53 67 57 68 61 62 63 64 70 74 65 66 75 76 77 69 81 83 71 72 85 73 86 88 89 90 92 94 96 78 100 101 104 107 110 79 111 80 82 112 113 ...

output:

248
355 356
350 361
357 358
331 359
334 364
332 335
337 366
369 370
371 372
316 317
339 340
373 433
318 324
427 434
389 435
429 448
320 424
436 438
385 386
403 404
406 408
410 413
414 421
390 445
399 415
306 449
308 391
392 393
394 396
416 442
265 450
375 378
417 452
453 455
268 270
300 303
379 456
...

result:

ok Correct

Test #35:

score: 0
Accepted
time: 136ms
memory: 5108kb

input:

497
6 1 2 10 11 3 12 4 15 5 7 8 16 17 18 19 21 25 26 30 31 9 32 13 14 20 33 35 37 40 41 43 22 45 23 46 24 27 49 50 28 52 53 29 54 58 59 34 36 38 39 42 44 47 61 48 51 63 55 67 68 69 56 57 72 60 62 77 78 79 80 64 65 82 85 87 88 66 89 91 98 102 70 104 71 111 112 113 117 118 120 73 125 129 130 74 75 131...

output:

249
147 168
169 170
171 172
247 248
143 148
149 150
162 163
164 178
240 241
245 249
285 286
129 130
151 152
153 235
242 251
258 283
287 288
154 155
156 157
158 173
222 223
224 226
227 228
229 264
267 268
281 356
357 362
363 366
131 133
180 230
252 253
259 260
261 262
277 290
360 364
367 368
125 214
...

result:

ok Correct

Test #36:

score: 0
Accepted
time: 143ms
memory: 5100kb

input:

498
2 8 10 11 1 3 4 12 15 5 6 17 21 7 22 9 24 27 28 13 31 32 35 40 14 42 47 16 18 19 20 50 51 23 52 25 53 26 29 30 33 54 55 56 59 34 61 63 36 37 65 67 38 69 70 39 72 41 75 43 44 45 76 46 48 80 49 57 58 81 84 85 88 60 89 91 62 64 66 68 93 71 73 94 97 98 74 99 77 78 79 100 102 103 105 82 107 83 110 86...

output:

249
440 443
444 469
441 467
445 446
455 461
447 456
432 462
472 473
47 470
50 429
51 264
427 448
52 168
169 261
265 266
399 417
418 475
40 477
42 53
75 161
163 172
173 174
256 258
259 268
269 271
378 388
396 397
410 414
423 424
63 67
69 70
72 88
91 159
164 165
183 381
383 384
386 390
402 403
404 407...

result:

ok Correct

Test #37:

score: 0
Accepted
time: 143ms
memory: 5140kb

input:

499
5 7 11 12 13 1 17 18 20 22 24 2 3 25 26 27 4 29 31 6 32 33 8 9 10 14 15 34 35 16 19 21 23 28 41 30 36 37 42 45 38 39 46 49 40 50 51 43 52 44 47 48 54 59 53 65 55 67 68 71 56 57 74 75 78 79 58 81 86 87 88 89 60 91 61 98 99 100 102 103 112 62 113 63 114 64 115 116 66 117 69 120 70 121 72 122 124 7...

output:

250
226 289
229 286
280 287
222 231
236 237
238 239
240 281
232 234
273 282
214 218
241 242
243 244
246 268
269 271
274 275
215 216
210 248
290 321
291 312
314 315
257 319
258 261
307 309
259 322
293 316
323 324
325 328
253 377
294 302
326 330
337 378
194 250
331 332
341 379
159 380
160 161
182 186
...

result:

ok Correct

Test #38:

score: 0
Accepted
time: 142ms
memory: 5620kb

input:

500
1 4 10 12 13 15 17 18 2 20 23 27 3 28 29 5 30 6 7 8 9 11 31 33 14 35 16 36 37 38 39 19 40 42 21 48 49 53 55 56 58 59 60 22 24 62 63 65 25 66 69 26 32 71 75 34 41 78 79 81 82 83 86 43 44 88 90 45 46 47 91 92 50 51 93 52 94 97 98 99 54 100 101 57 61 102 104 105 108 64 109 67 110 68 70 112 72 113 1...

output:

250
293 299
283 289
290 297
281 301
284 294
302 303
279 304
265 305
357 390
263 272
273 355
392 420
349 358
359 421
237 266
306 360
362 363
403 414
230 417
247 251
253 254
255 256
258 267
307 313
346 351
385 400
404 405
409 410
225 243
245 381
393 407
217 218
219 227
233 238
239 241
248 382
215 397
...

result:

ok Correct

Test #39:

score: -12
Time Limit Exceeded

input:

7495
1 3 5 7 8 2 10 4 11 13 6 14 17 9 21 12 15 23 25 26 16 18 31 19 20 32 35 36 37 42 22 45 46 24 27 28 47 48 49 29 51 52 58 60 30 33 34 38 62 63 39 40 64 65 66 70 72 73 41 74 43 75 77 44 50 53 78 79 54 81 82 55 56 83 57 87 88 89 93 59 61 67 68 97 69 100 102 107 108 110 112 113 118 119 120 71 124 12...

output:

Unauthorized output

result:


Subtask #3:

score: 9
Accepted

Test #51:

score: 9
Accepted
time: 1ms
memory: 4604kb

input:

1
1

output:

1
1 2

result:

ok Correct

Test #52:

score: 0
Accepted
time: 1ms
memory: 4568kb

input:

2
1 2

output:

1
1 2

result:

ok Correct

Test #53:

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

input:

2
2 1

output:

2
2 3
1 3

result:

ok Correct

Test #54:

score: 0
Accepted
time: 1ms
memory: 4524kb

input:

3
1 3 2

output:

2
1 3
2 4

result:

ok Correct

Test #55:

score: 0
Accepted
time: 1ms
memory: 4852kb

input:

3
2 1 3

output:

2
2 3
1 4

result:

ok Correct

Test #56:

score: 0
Accepted
time: 1ms
memory: 4608kb

input:

3
2 3 1

output:

2
2 3
1 4

result:

ok Correct

Test #57:

score: 0
Accepted
time: 1ms
memory: 4628kb

input:

3
3 1 2

output:

2
3 4
1 2

result:

ok Correct

Test #58:

score: 0
Accepted
time: 1ms
memory: 4556kb

input:

4
2 1 4 3

output:

2
2 4
1 3

result:

ok Correct

Test #59:

score: 0
Accepted
time: 1ms
memory: 4588kb

input:

4
2 4 1 3

output:

2
2 4
1 3

result:

ok Correct

Test #60:

score: 0
Accepted
time: 1ms
memory: 4568kb

input:

4
3 1 4 2

output:

2
3 4
1 2

result:

ok Correct

Test #61:

score: 0
Accepted
time: 1ms
memory: 4548kb

input:

4
3 4 1 2

output:

2
3 4
1 2

result:

ok Correct

Test #62:

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

input:

3
3 2 1

output:

3
3 4
2 4
1 4

result:

ok Correct

Test #63:

score: 0
Accepted
time: 1ms
memory: 4524kb

input:

4
1 4 3 2

output:

3
1 4
3 5
2 5

result:

ok Correct

Test #64:

score: 0
Accepted
time: 1ms
memory: 4572kb

input:

4
2 4 3 1

output:

3
2 4
3 5
1 5

result:

ok Correct

Test #65:

score: 0
Accepted
time: 1ms
memory: 4564kb

input:

4
3 2 1 4

output:

3
3 4
2 5
1 5

result:

ok Correct

Test #66:

score: 0
Accepted
time: 1ms
memory: 4844kb

input:

4
3 2 4 1

output:

3
3 4
2 5
1 5

result:

ok Correct

Test #67:

score: 0
Accepted
time: 1ms
memory: 4572kb

input:

4
3 4 2 1

output:

3
3 4
2 5
1 5

result:

ok Correct

Test #68:

score: 0
Accepted
time: 1ms
memory: 4812kb

input:

4
4 1 3 2

output:

3
4 5
1 3
2 5

result:

ok Correct

Test #69:

score: 0
Accepted
time: 1ms
memory: 4568kb

input:

4
4 2 1 3

output:

3
4 5
2 3
1 5

result:

ok Correct

Test #70:

score: 0
Accepted
time: 1ms
memory: 4856kb

input:

4
4 2 3 1

output:

3
4 5
2 3
1 5

result:

ok Correct

Test #71:

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

input:

4
4 3 1 2

output:

3
4 5
3 5
1 2

result:

ok Correct

Test #72:

score: 0
Accepted
time: 1ms
memory: 4812kb

input:

4
4 3 2 1

output:

4
4 5
3 5
2 5
1 5

result:

ok Correct

Test #73:

score: 0
Accepted
time: 1ms
memory: 4860kb

input:

3
1 2 3

output:

2
1 2
3 4

result:

ok Correct

Test #74:

score: 0
Accepted
time: 1ms
memory: 4568kb

input:

4
1 2 3 4

output:

2
1 2
3 4

result:

ok Correct

Test #75:

score: 0
Accepted
time: 1ms
memory: 4848kb

input:

4
1 2 4 3

output:

2
1 4
2 3

result:

ok Correct

Test #76:

score: 0
Accepted
time: 1ms
memory: 4572kb

input:

4
1 3 2 4

output:

2
1 3
2 4

result:

ok Correct

Test #77:

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

input:

4
1 3 4 2

output:

2
3 4
1 2

result:

ok Correct

Test #78:

score: 0
Accepted
time: 1ms
memory: 4564kb

input:

4
1 4 2 3

output:

2
1 4
2 3

result:

ok Correct

Test #79:

score: 0
Accepted
time: 1ms
memory: 4808kb

input:

4
2 1 3 4

output:

2
2 3
1 4

result:

ok Correct

Test #80:

score: 0
Accepted
time: 1ms
memory: 4836kb

input:

4
2 3 1 4

output:

2
2 3
1 4

result:

ok Correct

Test #81:

score: 0
Accepted
time: 1ms
memory: 4556kb

input:

4
2 3 4 1

output:

3
2 3
4 5
1 5

result:

ok Correct

Test #82:

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

input:

4
3 1 2 4

output:

2
3 4
1 2

result:

ok Correct

Test #83:

score: 0
Accepted
time: 1ms
memory: 4840kb

input:

4
4 1 2 3

output:

3
4 5
1 2
3 5

result:

ok Correct

Subtask #4:

score: 0
Wrong Answer

Dependency #3:

100%
Accepted

Test #84:

score: 12
Accepted
time: 0ms
memory: 4564kb

input:

16
13 7 10 1 9 15 4 11 12 2 8 16 3 5 14 6

output:

8
13 15
7 10
9 11
12 16
4 8
1 14
2 3
5 6

result:

ok Correct

Test #85:

score: 0
Accepted
time: 1ms
memory: 4548kb

input:

16
13 7 10 1 9 15 4 11 12 2 8 16 3 5 14 6

output:

8
13 15
7 10
9 11
12 16
4 8
1 14
2 3
5 6

result:

ok Correct

Test #86:

score: 0
Accepted
time: 1ms
memory: 4848kb

input:

16
13 7 10 1 9 15 4 11 12 2 8 16 3 5 14 6

output:

8
13 15
7 10
9 11
12 16
4 8
1 14
2 3
5 6

result:

ok Correct

Test #87:

score: 0
Accepted
time: 1ms
memory: 4852kb

input:

16
13 7 10 1 9 15 4 11 12 2 8 16 3 5 14 6

output:

8
13 15
7 10
9 11
12 16
4 8
1 14
2 3
5 6

result:

ok Correct

Test #88:

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

input:

16
13 7 10 1 9 15 4 11 12 2 8 16 3 5 14 6

output:

8
13 15
7 10
9 11
12 16
4 8
1 14
2 3
5 6

result:

ok Correct

Test #89:

score: 0
Accepted
time: 1ms
memory: 4516kb

input:

16
13 7 10 1 9 15 4 11 12 2 8 16 3 5 14 6

output:

8
13 15
7 10
9 11
12 16
4 8
1 14
2 3
5 6

result:

ok Correct

Test #90:

score: 0
Accepted
time: 1ms
memory: 4808kb

input:

16
14 13 16 15 12 11 10 9 8 7 6 5 4 3 2 1

output:

14
14 16
13 15
12 17
11 17
10 17
9 17
8 17
7 17
6 17
5 17
4 17
3 17
2 17
1 17

result:

ok Correct

Test #91:

score: 0
Accepted
time: 1ms
memory: 4808kb

input:

16
13 16 10 14 15 9 11 12 8 7 6 5 4 3 2 1

output:

12
13 16
14 15
10 11
9 12
8 17
7 17
6 17
5 17
4 17
3 17
2 17
1 17

result:

ok Correct

Test #92:

score: 0
Accepted
time: 1ms
memory: 4516kb

input:

16
16 14 15 13 11 9 10 12 6 7 4 8 5 3 2 1

output:

11
16 17
14 15
13 17
11 12
9 10
6 7
4 8
5 17
3 17
2 17
1 17

result:

ok Correct

Test #93:

score: 0
Accepted
time: 1ms
memory: 4548kb

input:

16
1 2 3 5 8 4 7 6 12 10 9 11 13 15 14 16

output:

8
8 12
5 7
10 15
1 2
3 4
6 9
11 13
14 16

result:

ok Correct

Test #94:

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

input:

16
15 14 16 11 13 12 9 10 8 7 6 5 4 1 2 3

output:

12
15 16
14 17
11 13
12 17
9 10
8 17
7 17
6 17
5 17
4 17
1 2
3 17

result:

ok Correct

Test #95:

score: 0
Accepted
time: 1ms
memory: 4856kb

input:

16
14 15 13 16 11 12 10 9 8 7 6 4 5 2 1 3

output:

11
14 15
13 16
11 12
10 17
9 17
8 17
7 17
6 17
4 5
2 3
1 17

result:

ok Correct

Test #96:

score: -12
Wrong Answer
time: 0ms
memory: 4808kb

input:

8
4 3 7 8 2 1 5 6

output:

5
7 8
4 5
3 6
2 9
1 9

result:

wrong answer Incorrect

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

0%