QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#375357#4088. 총 쏘기hotboy270317 29ms6660kbC++142.0kb2024-04-03 09:43:402024-04-03 09:43:40

Judging History

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

  • [2024-04-03 09:43:40]
  • 评测
  • 测评结果:17
  • 用时:29ms
  • 内存:6660kb
  • [2024-04-03 09:43:40]
  • 提交

answer

#include<bits/stdc++.h>
using ll = int;
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];
    vector <pair <ll,ll> > ans;
    namespace seg{
        ll tree[MAXN*4+100];
        ll best(ll x,ll y){
            return (a[x] > a[y]) ? x : y;
        }
        void build(ll id = 1,ll l = 1,ll r = n){
            if (l == r){
                tree[id] = l;
                return;
            }
            else{
                ll mid = (l + r)>>1;
                build(id<<1,l,mid);
                build(id<<1|1,mid+1,r);
                tree[id] = best(tree[id<<1],tree[id<<1|1]);
            }
        }
        void update(ll i,ll id = 1,ll l = 1,ll r = n){
            if (i > r || i < l)return;
            if (l == r){
                tree[id] = 0;
                return;
            }
            ll mid = (l + r)>>1;
            update(i,id<<1,l,mid);
            update(i,id<<1|1,mid+1,r);
            tree[id] = best(tree[id<<1],tree[id<<1|1]);
        }
        ll get(ll i,ll id = 1,ll l = 1,ll r = n){
            if (i < l)return 0;
            if (r <= i)return tree[id];
            ll mid = (l + r) >> 1;
            return best(get(i,id<<1,l,mid),get(i,id<<1|1,mid+1,r));
        }
    }
    void solve(){
        seg::build();
        ll cnt = 0;
        while (cnt < n){
            ll max1 = seg::get(n);
            seg::update(max1);
            ll max2 = seg::get(max1);
            seg::update(max2);
            cnt += (max1 > 0) + (max2 > 0);
            pll tmp = MP(n+1,a[max1]);
            if (max2)tmp.fi = a[max2];
            ans.push_back(tmp);
        }
    }
}
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: 17
Accepted

Test #1:

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

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: 3808kb

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
17 8
4 7
2 6
17 5
17 3
17 1

result:

ok Correct

Test #3:

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

input:

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

output:

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

result:

ok Correct

Test #4:

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

input:

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

output:

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

result:

ok Correct

Test #5:

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

input:

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

output:

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

result:

ok Correct

Test #6:

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

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: 3784kb

input:

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

output:

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

result:

ok Correct

Test #8:

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

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
496 485
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
496 452
450 451
496 449
496 448
496 447
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: 1ms
memory: 4092kb

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
497 490
497 489
473 488
497 487
472 485
469 484
468 483
464 482
497 480
463 479
497 478
497 477
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: 0ms
memory: 3800kb

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
498 485
498 484
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: 1ms
memory: 3760kb

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
499 494
499 493
489 492
499 491
488 490
485 487
482 486
499 484
481 483
479 480
499 478
475 477
474 476
499 473
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: 1ms
memory: 3788kb

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
500 494
500 493
500 491
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
500 470
453 469
452 468
451 467
448 466
447 462
446 458
445 457
439 454
434 450
433 449
432 444
500 443
430 442
500 441
428 440
500 438
...

result:

ok Correct

Test #13:

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

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: 0
Accepted
time: 2ms
memory: 4020kb

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:

3773
7496 7495
7490 7494
7488 7493
7486 7492
7481 7491
7480 7489
7478 7487
7477 7485
7475 7484
7463 7483
7460 7482
7459 7479
7458 7476
7457 7474
7455 7473
7454 7472
7453 7471
7452 7470
7450 7469
7448 7468
7444 7467
7442 7466
7440 7465
7435 7464
7431 7462
7426 7461
7423 7456
7422 7451
7421 7449
7418 ...

result:

ok Correct

Test #15:

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

input:

7496
7493 7496 7495 7490 7494 7489 7492 7491 7484 7476 7488 7487 7473 7471 7470 7468 7467 7465 7462 7456 7486 7455 7453 7451 7485 7446 7483 7482 7481 7480 7479 7478 7477 7445 7444 7475 7439 7435 7474 7472 7433 7432 7469 7430 7429 7428 7466 7464 7463 7427 7461 7460 7423 7422 7420 7459 7458 7418 7415 ...

output:

3779
7493 7496
7497 7495
7490 7494
7489 7492
7497 7491
7484 7488
7476 7487
7473 7486
7471 7485
7470 7483
7468 7482
7467 7481
7465 7480
7462 7479
7456 7478
7455 7477
7453 7475
7451 7474
7446 7472
7445 7469
7444 7466
7439 7464
7435 7463
7433 7461
7432 7460
7430 7459
7429 7458
7428 7457
7427 7454
7423 ...

result:

ok Correct

Test #16:

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

input:

7497
7493 7490 7489 7488 7487 7486 7497 7485 7496 7482 7495 7481 7480 7479 7478 7494 7492 7477 7470 7491 7469 7484 7483 7476 7468 7475 7466 7462 7474 7461 7473 7458 7457 7455 7472 7454 7453 7450 7447 7471 7445 7467 7465 7444 7464 7443 7442 7440 7463 7439 7460 7459 7438 7437 7435 7430 7456 7452 7427 ...

output:

3790
7493 7497
7490 7496
7489 7495
7488 7494
7487 7492
7486 7491
7498 7485
7482 7484
7481 7483
7498 7480
7498 7479
7498 7478
7498 7477
7470 7476
7469 7475
7468 7474
7466 7473
7462 7472
7461 7471
7458 7467
7457 7465
7455 7464
7454 7463
7453 7460
7450 7459
7447 7456
7445 7452
7444 7451
7443 7449
7442 ...

result:

ok Correct

Test #17:

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

input:

7498
7495 7494 7492 7488 7498 7497 7487 7486 7485 7496 7484 7483 7493 7491 7482 7490 7480 7489 7478 7477 7473 7472 7469 7481 7465 7464 7479 7476 7475 7463 7462 7459 7458 7474 7457 7456 7471 7470 7454 7452 7450 7447 7446 7468 7467 7444 7443 7439 7466 7438 7461 7437 7460 7455 7435 7434 7453 7433 7431 ...

output:

3768
7495 7498
7494 7497
7492 7496
7488 7493
7487 7491
7486 7490
7485 7489
7499 7484
7499 7483
7499 7482
7480 7481
7478 7479
7499 7477
7473 7476
7472 7475
7469 7474
7465 7471
7464 7470
7463 7468
7462 7467
7459 7466
7458 7461
7457 7460
7499 7456
7454 7455
7452 7453
7450 7451
7447 7449
7446 7448
7444 ...

result:

ok Correct

Test #18:

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

input:

7499
7498 7499 7491 7497 7496 7487 7495 7494 7485 7481 7479 7493 7492 7490 7489 7477 7488 7476 7471 7486 7470 7484 7464 7483 7463 7482 7460 7480 7459 7478 7475 7454 7452 7474 7473 7472 7451 7450 7449 7448 7446 7469 7468 7467 7466 7465 7443 7462 7438 7461 7458 7457 7456 7428 7455 7426 7425 7424 7423 ...

output:

3766
7498 7499
7491 7497
7500 7496
7487 7495
7500 7494
7485 7493
7481 7492
7479 7490
7500 7489
7477 7488
7476 7486
7471 7484
7470 7483
7464 7482
7463 7480
7460 7478
7459 7475
7454 7474
7452 7473
7500 7472
7451 7469
7450 7468
7449 7467
7448 7466
7446 7465
7443 7462
7438 7461
7500 7458
7500 7457
7500 ...

result:

ok Correct

Test #19:

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

input:

7500
7500 7498 7499 7497 7492 7490 7488 7485 7481 7479 7476 7471 7496 7470 7469 7495 7494 7466 7493 7491 7460 7489 7459 7458 7456 7455 7487 7453 7486 7450 7447 7484 7446 7443 7440 7436 7435 7483 7482 7430 7424 7423 7422 7480 7421 7478 7418 7416 7477 7413 7475 7411 7474 7473 7472 7468 7410 7467 7408 ...

output:

3788
7501 7500
7498 7499
7501 7497
7492 7496
7490 7495
7488 7494
7485 7493
7481 7491
7479 7489
7476 7487
7471 7486
7470 7484
7469 7483
7466 7482
7460 7480
7459 7478
7458 7477
7456 7475
7455 7474
7453 7473
7450 7472
7447 7468
7446 7467
7443 7465
7440 7464
7436 7463
7435 7462
7430 7461
7424 7457
7423 ...

result:

ok Correct

Test #20:

score: 0
Accepted
time: 28ms
memory: 6184kb

input:

99995
99992 99990 99995 99994 99989 99993 99985 99991 99979 99974 99970 99988 99987 99986 99969 99984 99965 99983 99982 99964 99981 99962 99961 99960 99958 99955 99980 99953 99978 99951 99977 99976 99950 99975 99948 99946 99939 99973 99936 99935 99930 99928 99972 99924 99971 99968 99923 99922 99920 ...

output:

50171
99992 99995
99990 99994
99989 99993
99985 99991
99979 99988
99974 99987
99970 99986
99969 99984
99965 99983
99996 99982
99964 99981
99962 99980
99961 99978
99960 99977
99958 99976
99955 99975
99953 99973
99951 99972
99950 99971
99948 99968
99946 99967
99939 99966
99936 99963
99935 99959
99930 ...

result:

ok Correct

Test #21:

score: 0
Accepted
time: 23ms
memory: 6140kb

input:

99996
99996 99994 99993 99992 99990 99995 99988 99991 99981 99989 99978 99975 99987 99974 99986 99973 99970 99985 99984 99983 99982 99980 99968 99979 99967 99964 99963 99960 99959 99956 99977 99976 99972 99971 99955 99954 99969 99966 99950 99948 99943 99941 99965 99940 99938 99962 99936 99933 99961 ...

output:

50088
99997 99996
99994 99995
99997 99993
99997 99992
99990 99991
99988 99989
99981 99987
99978 99986
99975 99985
99974 99984
99973 99983
99970 99982
99997 99980
99968 99979
99967 99977
99964 99976
99963 99972
99960 99971
99959 99969
99956 99966
99955 99965
99954 99962
99950 99961
99948 99958
99943 ...

result:

ok Correct

Test #22:

score: 0
Accepted
time: 28ms
memory: 6192kb

input:

99997
99993 99989 99988 99997 99996 99987 99995 99983 99982 99994 99992 99991 99981 99979 99990 99978 99977 99976 99974 99986 99985 99972 99970 99984 99980 99975 99968 99973 99971 99967 99963 99962 99956 99969 99966 99965 99964 99961 99960 99955 99954 99952 99959 99951 99948 99958 99946 99957 99953 ...

output:

50114
99993 99997
99989 99996
99988 99995
99987 99994
99983 99992
99982 99991
99981 99990
99979 99986
99978 99985
99977 99984
99976 99980
99974 99975
99972 99973
99970 99971
99968 99969
99998 99967
99963 99966
99962 99965
99956 99964
99998 99961
99998 99960
99955 99959
99954 99958
99952 99957
99951 ...

result:

ok Correct

Test #23:

score: 0
Accepted
time: 29ms
memory: 6256kb

input:

99998
99996 99994 99998 99997 99991 99995 99989 99993 99992 99988 99986 99985 99982 99980 99990 99979 99987 99984 99983 99978 99977 99973 99972 99971 99969 99981 99976 99975 99968 99966 99974 99965 99959 99970 99958 99967 99957 99956 99954 99951 99950 99949 99948 99964 99963 99962 99947 99946 99945 ...

output:

50122
99996 99998
99994 99997
99991 99995
99989 99993
99999 99992
99988 99990
99986 99987
99999 99985
99982 99984
99980 99983
99979 99981
99999 99978
99999 99977
99973 99976
99972 99975
99971 99974
99969 99970
99999 99968
99966 99967
99999 99965
99959 99964
99958 99963
99957 99962
99956 99961
99954 ...

result:

ok Correct

Test #24:

score: 0
Accepted
time: 28ms
memory: 6588kb

input:

99999
99997 99999 99995 99987 99986 99984 99998 99978 99977 99976 99996 99975 99994 99993 99971 99969 99992 99965 99991 99990 99962 99989 99960 99988 99985 99983 99982 99957 99953 99981 99950 99980 99949 99979 99946 99974 99973 99972 99943 99970 99968 99942 99967 99966 99964 99963 99961 99959 99941 ...

output:

50253
99997 99999
99995 99998
99987 99996
99986 99994
99984 99993
99978 99992
99977 99991
99976 99990
99975 99989
99971 99988
99969 99985
99965 99983
99962 99982
99960 99981
99957 99980
99953 99979
99950 99974
99949 99973
99946 99972
99943 99970
100000 99968
99942 99967
100000 99966
100000 99964
100...

result:

ok Correct

Test #25:

score: 0
Accepted
time: 28ms
memory: 6660kb

input:

100000
99999 100000 99995 99998 99986 99984 99981 99974 99972 99997 99971 99967 99996 99965 99957 99956 99994 99955 99993 99992 99991 99990 99954 99989 99953 99952 99988 99987 99947 99940 99939 99938 99937 99985 99983 99982 99980 99927 99926 99979 99920 99978 99977 99976 99918 99975 99973 99970 9996...

output:

50194
99999 100000
99995 99998
99986 99997
99984 99996
99981 99994
99974 99993
99972 99992
99971 99991
99967 99990
99965 99989
99957 99988
99956 99987
99955 99985
99954 99983
99953 99982
99952 99980
99947 99979
99940 99978
99939 99977
99938 99976
99937 99975
99927 99973
99926 99970
99920 99969
99918...

result:

ok Correct

Subtask #2:

score: 0
Wrong Answer

Test #26:

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

input:

8
5 6 7 1 2 8 3 4

output:

4
7 8
5 6
3 4
1 2

result:

ok Correct

Test #27:

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

input:

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

output:

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

result:

ok Correct

Test #28:

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

input:

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

output:

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

result:

wrong answer Incorrect

Subtask #3:

score: 0
Wrong Answer

Test #51:

score: 9
Accepted
time: 0ms
memory: 3780kb

input:

1
1

output:

1
2 1

result:

ok Correct

Test #52:

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

input:

2
1 2

output:

1
1 2

result:

ok Correct

Test #53:

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

input:

2
2 1

output:

2
3 2
3 1

result:

ok Correct

Test #54:

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

input:

3
1 3 2

output:

2
1 3
4 2

result:

ok Correct

Test #55:

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

input:

3
2 1 3

output:

2
2 3
4 1

result:

ok Correct

Test #56:

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

input:

3
2 3 1

output:

2
2 3
4 1

result:

ok Correct

Test #57:

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

input:

3
3 1 2

output:

2
4 3
1 2

result:

ok Correct

Test #58:

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

input:

4
2 1 4 3

output:

2
2 4
1 3

result:

ok Correct

Test #59:

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

input:

4
2 4 1 3

output:

2
2 4
1 3

result:

ok Correct

Test #60:

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

input:

4
3 1 4 2

output:

2
3 4
1 2

result:

ok Correct

Test #61:

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

input:

4
3 4 1 2

output:

2
3 4
1 2

result:

ok Correct

Test #62:

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

input:

3
3 2 1

output:

3
4 3
4 2
4 1

result:

ok Correct

Test #63:

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

input:

4
1 4 3 2

output:

3
1 4
5 3
5 2

result:

ok Correct

Test #64:

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

input:

4
2 4 3 1

output:

3
2 4
5 3
5 1

result:

ok Correct

Test #65:

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

input:

4
3 2 1 4

output:

3
3 4
5 2
5 1

result:

ok Correct

Test #66:

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

input:

4
3 2 4 1

output:

3
3 4
5 2
5 1

result:

ok Correct

Test #67:

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

input:

4
3 4 2 1

output:

3
3 4
5 2
5 1

result:

ok Correct

Test #68:

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

input:

4
4 1 3 2

output:

3
5 4
1 3
5 2

result:

ok Correct

Test #69:

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

input:

4
4 2 1 3

output:

3
5 4
2 3
5 1

result:

ok Correct

Test #70:

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

input:

4
4 2 3 1

output:

3
5 4
2 3
5 1

result:

ok Correct

Test #71:

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

input:

4
4 3 1 2

output:

3
5 4
5 3
1 2

result:

ok Correct

Test #72:

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

input:

4
4 3 2 1

output:

4
5 4
5 3
5 2
5 1

result:

ok Correct

Test #73:

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

input:

3
1 2 3

output:

2
2 3
4 1

result:

ok Correct

Test #74:

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

input:

4
1 2 3 4

output:

2
3 4
1 2

result:

ok Correct

Test #75:

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

input:

4
1 2 4 3

output:

2
2 4
1 3

result:

ok Correct

Test #76:

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

input:

4
1 3 2 4

output:

2
3 4
1 2

result:

ok Correct

Test #77:

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

input:

4
1 3 4 2

output:

2
3 4
1 2

result:

ok Correct

Test #78:

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

input:

4
1 4 2 3

output:

2
1 4
2 3

result:

ok Correct

Test #79:

score: -9
Wrong Answer
time: 1ms
memory: 3788kb

input:

4
2 1 3 4

output:

3
3 4
5 2
5 1

result:

wrong answer Incorrect

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%