QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#136664 | #1866. Decomposition | elimva | AC ✓ | 245ms | 3876kb | C++14 | 1.2kb | 2023-08-09 09:50:47 | 2023-08-09 09:50:51 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, e) for (int i = s; i <= e; ++i)
#define drep(i, s, e) for (int i = s; i >= e; --i)
#define file(a) freopen(#a".in", "r", stdin), freopen(#a".out", "w", stdout)
#define pv(a) cout << #a << " = " << a << endl
#define pa(a, l, r) cout << #a " : "; rep(_, l, r) cout << a[_] << ' '; cout << endl
int read() {
int x = 0, f = 1; char c = getchar();
for (; c < '0' || c > '9'; c = getchar()) if (c == '-') f = -1;
for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - 48;
return x * f;
}
void solve(int id) {
printf("Case #%d:\n", id);
int n = read(), k = read();
int cur = read();
printf("%d ", n);
auto print = [&](int x) {
printf("%d", x);
if (--cur == 0) {
printf("\n");
if (--k) {
cur = read();
printf("%d ", x);
}
}
else printf(" ");
} ;
rep(i, 1, n / 2) {
print(i);
for (int u = i, j = 1; j <= n - 2; ++j) {
if (j & 1) u = (u + j - 1) % (n - 1) + 1;
else u = (u - j - 1 + (n - 1)) % (n - 1) + 1;
print(u);
}
print(n);
}
}
int main() {
int tc = read();
rep(i, 1, tc) solve(i);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3876kb
input:
3 5 6 2 1 1 2 2 2 7 8 1 1 4 3 4 1 3 4 5 10 1 1 1 1 1 1 1 1 1 1
output:
Case #1: 5 1 2 2 4 4 3 3 5 2 2 3 1 1 4 5 Case #2: 7 1 1 2 2 6 3 5 4 4 7 2 3 3 1 4 6 5 5 7 7 3 4 2 2 5 1 6 7 Case #3: 5 1 1 2 2 4 4 3 3 5 5 2 2 3 3 1 1 4 4 5
result:
ok OK, 3 cases
Test #2:
score: 0
Accepted
time: 26ms
memory: 3596kb
input:
5000 13 12 5 8 9 7 5 4 10 10 7 9 2 2 7 13 2 2 1 2 2 2 3 1 1 1 2 1 1 11 16 1 1 5 4 6 2 5 1 5 8 1 1 7 3 4 1 13 17 4 1 9 1 8 1 7 6 4 8 2 8 5 8 4 1 1 5 6 1 2 1 2 2 2 9 9 5 4 5 4 5 1 6 1 5 17 23 4 9 1 10 5 8 8 7 4 11 2 4 6 3 6 7 11 3 10 7 4 5 1 13 14 10 9 1 1 1 10 3 8 8 10 3 3 10 1 7 8 4 1 4 1 4 3 2 2 19...
output:
Case #1: 13 1 2 12 3 11 11 4 10 5 9 6 8 7 13 13 2 3 1 4 12 5 11 6 10 10 7 9 8 13 3 4 2 2 5 1 6 12 7 7 11 8 10 9 9 13 4 5 3 6 2 7 1 8 12 12 9 11 10 13 5 6 4 7 3 8 8 2 9 1 10 12 11 13 13 6 7 5 8 4 9 3 10 2 2 11 1 1 12 13 Case #2: 7 1 2 2 6 3 3 5 5 4 7 7 2 3 3 1 4 4 6 5 7 7 3 3 4 4 2 2 5 1 1 6 6 7 Case...
result:
ok OK, 5000 cases
Test #3:
score: 0
Accepted
time: 17ms
memory: 3596kb
input:
2000 27 44 5 15 4 6 7 14 9 2 1 24 9 4 12 6 13 23 7 3 21 2 5 2 3 20 8 12 10 21 3 1 6 8 8 4 5 3 19 1 10 7 4 1 1 2 29 31 25 8 18 22 7 7 25 9 26 25 6 11 20 1 7 9 11 14 23 20 1 13 16 1 22 23 14 6 13 1 2 27 27 16 24 6 12 3 3 22 2 24 12 6 10 18 14 8 21 20 14 15 4 23 20 2 14 11 23 4 29 39 15 19 3 7 1 13 20 ...
output:
Case #1: 27 1 2 26 3 25 25 4 24 5 23 6 22 7 21 8 20 9 19 10 18 11 11 17 12 16 13 13 15 14 27 2 3 1 1 4 26 5 25 6 24 7 7 23 8 22 9 21 10 20 11 19 12 18 13 17 14 14 16 15 27 3 4 2 5 1 6 6 26 7 7 25 25 8 24 9 23 10 22 11 21 12 20 13 19 14 18 15 17 16 27 4 5 3 6 2 7 7 1 8 26 9 25 10 24 11 23 23 12 22 13...
result:
ok OK, 2000 cases
Test #4:
score: 0
Accepted
time: 24ms
memory: 3572kb
input:
800 9 11 5 5 4 1 1 5 5 6 2 1 1 11 14 5 7 5 1 3 3 6 8 3 7 2 3 1 1 19 22 14 10 8 2 9 12 13 2 6 5 8 5 5 1 12 1 10 13 10 2 14 9 9 9 6 5 3 4 3 4 4 6 1 5 7 2 1 1 2 1 2 1 5 7 1 2 2 2 1 1 1 31 29 20 8 18 13 1 24 12 9 12 19 24 25 21 23 6 27 12 10 17 19 23 26 23 5 28 14 11 2 13 49 48 42 46 45 12 5 24 16 28 40...
output:
Case #1: 9 1 2 8 3 7 7 4 6 5 9 2 2 3 1 4 8 8 5 5 7 7 6 9 3 4 2 2 5 1 6 8 7 7 9 4 5 3 6 2 2 7 1 1 8 8 9 Case #2: 11 1 2 10 3 9 9 4 8 5 7 6 11 2 2 3 1 4 10 5 5 9 9 6 8 7 7 11 3 4 4 2 5 1 6 10 7 7 9 8 11 4 5 3 6 2 2 7 1 8 8 10 9 11 5 6 4 7 7 3 8 8 2 9 1 1 10 10 11 Case #3: 19 1 2 18 3 17 4 16 5 15 6 14...
result:
ok OK, 800 cases
Test #5:
score: 0
Accepted
time: 22ms
memory: 3640kb
input:
200 23 26 6 17 15 16 8 5 3 20 8 17 16 8 10 10 10 10 14 1 16 12 7 6 2 4 10 2 47 45 40 15 13 24 37 4 37 8 27 44 12 11 38 19 41 26 22 33 13 26 20 40 39 37 21 16 32 14 9 8 32 36 43 28 29 4 26 38 23 34 5 23 17 16 1 11 12 4 6 7 7 8 4 8 3 1 2 3 2 89 89 57 9 68 20 45 8 78 59 16 83 72 8 42 39 76 76 28 72 46 ...
output:
Case #1: 23 1 2 22 3 21 4 4 20 5 19 6 18 7 17 8 16 9 15 10 14 11 13 12 23 23 2 3 1 4 22 5 21 6 20 7 19 8 18 9 17 17 10 16 11 15 12 14 13 23 3 4 2 5 1 6 22 7 7 21 8 20 9 19 10 18 11 11 17 12 16 13 15 15 14 23 4 4 5 3 6 2 7 1 8 22 9 21 10 20 11 19 12 18 13 17 14 16 16 15 23 5 6 4 7 3 8 8 2 9 1 10 22 1...
result:
ok OK, 200 cases
Test #6:
score: 0
Accepted
time: 18ms
memory: 3808kb
input:
8 123 123 11 68 57 31 101 57 58 24 104 69 103 1 3 32 74 103 13 86 90 112 64 109 25 68 60 102 89 50 112 37 53 93 24 115 93 21 56 82 80 13 71 54 94 16 6 57 20 39 54 76 48 57 75 35 63 11 86 102 32 20 65 15 81 15 98 14 102 57 92 94 46 104 56 60 57 120 31 114 23 111 15 96 68 93 50 26 114 79 103 59 106 60...
output:
Case #1: 123 1 2 122 3 121 4 120 5 119 6 118 118 7 117 8 116 9 115 10 114 11 113 12 112 13 111 14 110 15 109 16 108 17 107 18 106 19 105 20 104 21 103 22 102 23 101 24 100 25 99 26 98 27 97 28 96 29 95 30 94 31 93 32 92 33 91 34 90 35 89 36 88 37 87 38 86 39 85 40 84 84 41 83 42 82 43 81 44 80 45 79...
result:
ok OK, 8 cases
Test #7:
score: 0
Accepted
time: 38ms
memory: 3592kb
input:
2 931 941 37 625 158 286 652 892 205 242 367 627 914 33 501 700 280 117 693 593 389 547 807 758 160 565 24 601 784 551 322 749 463 504 681 221 8 857 511 554 45 797 828 538 779 876 868 475 607 43 161 692 514 687 717 420 610 570 389 112 587 551 890 101 128 371 621 186 263 926 332 130 21 898 311 436 32...
output:
Case #1: 931 1 2 930 3 929 4 928 5 927 6 926 7 925 8 924 9 923 10 922 11 921 12 920 13 919 14 918 15 917 16 916 17 915 18 914 19 913 913 20 912 21 911 22 910 23 909 24 908 25 907 26 906 27 905 28 904 29 903 30 902 31 901 32 900 33 899 34 898 35 897 36 896 37 895 38 894 39 893 40 892 41 891 42 890 43...
result:
ok OK, 2 cases
Test #8:
score: 0
Accepted
time: 15ms
memory: 3660kb
input:
2 57 60 24 19 36 48 4 43 19 52 8 52 6 17 10 19 18 41 20 36 4 41 38 34 24 26 29 48 15 37 10 7 4 8 16 43 8 9 27 38 12 19 52 31 9 54 49 15 51 24 43 54 29 46 12 40 17 36 50 12 2 1 643 646 230 5 469 246 610 243 221 411 352 98 56 243 481 622 240 492 349 336 548 102 516 326 468 563 272 363 99 156 468 562 5...
output:
Case #1: 57 1 2 56 3 55 4 54 5 53 6 52 7 51 8 50 9 49 10 48 11 47 12 46 13 13 45 14 44 15 43 16 42 17 41 18 40 19 39 20 38 21 37 22 36 36 23 35 24 34 25 33 26 32 27 31 28 30 29 57 2 3 1 4 56 5 55 6 54 7 53 8 52 9 51 10 50 11 49 12 48 13 13 47 14 46 15 45 16 44 17 43 18 42 19 41 20 40 21 39 22 38 23 ...
result:
ok OK, 2 cases
Test #9:
score: 0
Accepted
time: 28ms
memory: 3820kb
input:
2 939 935 96 887 857 430 351 403 292 594 392 287 841 710 428 591 389 218 248 134 924 445 162 52 491 820 314 711 207 112 874 201 908 448 799 207 6 690 782 141 749 623 628 466 495 700 861 588 791 93 364 36 834 772 774 619 615 46 358 5 493 382 121 891 71 564 219 201 496 495 883 781 546 394 548 936 643 ...
output:
Case #1: 939 1 2 938 3 937 4 936 5 935 6 934 7 933 8 932 9 931 10 930 11 929 12 928 13 927 14 926 15 925 16 924 17 923 18 922 19 921 20 920 21 919 22 918 23 917 24 916 25 915 26 914 27 913 28 912 29 911 30 910 31 909 32 908 33 907 34 906 35 905 36 904 37 903 38 902 39 901 40 900 41 899 42 898 43 897...
result:
ok OK, 2 cases
Test #10:
score: 0
Accepted
time: 29ms
memory: 3552kb
input:
2 763 776 379 463 566 538 49 15 664 613 227 59 631 331 374 87 4 325 559 80 459 107 528 340 427 420 99 171 492 465 572 316 723 598 423 135 14 156 604 99 648 509 657 449 715 50 157 652 701 521 644 529 420 385 173 55 758 649 311 135 744 47 370 488 40 405 722 284 443 676 57 552 283 241 26 449 522 201 10...
output:
Case #1: 763 1 2 762 3 761 4 760 5 759 6 758 7 757 8 756 9 755 10 754 11 753 12 752 13 751 14 750 15 749 16 748 17 747 18 746 19 745 20 744 21 743 22 742 23 741 24 740 25 739 26 738 27 737 28 736 29 735 30 734 31 733 32 732 33 731 34 730 35 729 36 728 37 727 38 726 39 725 40 724 41 723 42 722 43 721...
result:
ok OK, 2 cases
Test #11:
score: 0
Accepted
time: 72ms
memory: 3644kb
input:
18181 11 14 7 1 6 2 7 3 2 7 2 4 5 4 4 1 11 10 8 5 6 8 6 4 6 1 7 4 11 13 7 8 7 3 3 7 1 3 1 4 3 6 2 11 14 3 1 5 3 8 1 4 8 4 8 1 5 3 1 11 15 5 3 2 5 1 5 7 8 2 6 4 4 1 1 1 11 11 6 1 7 5 6 7 6 6 4 5 2 11 12 6 3 5 2 5 8 6 3 4 8 4 1 11 12 3 8 4 3 4 7 2 5 6 6 6 1 11 15 5 5 1 2 5 7 6 1 6 5 6 1 3 1 1 11 15 7 ...
output:
Case #1: 11 1 2 10 3 9 4 8 8 5 5 7 6 11 2 3 1 1 4 10 10 5 9 6 8 7 11 3 3 4 2 5 5 1 6 6 10 7 9 8 11 4 5 5 3 6 6 2 7 1 8 8 10 9 11 5 6 6 4 7 3 8 8 2 9 1 10 10 11 Case #2: 11 1 2 10 3 9 4 8 5 5 7 6 11 2 3 3 1 4 10 5 9 6 6 8 7 11 3 4 2 5 1 1 6 10 7 9 8 11 11 4 5 3 6 6 2 7 1 8 10 9 9 11 11 5 6 4 7 3 8 2 ...
result:
ok OK, 18181 cases
Test #12:
score: 0
Accepted
time: 67ms
memory: 3664kb
input:
4700 21 25 6 14 1 10 8 8 18 5 15 9 15 3 4 3 12 12 18 10 4 1 13 6 8 3 4 21 23 9 15 17 10 2 12 12 12 9 6 8 1 4 8 9 6 16 18 2 14 10 8 2 21 21 17 16 5 9 14 8 14 17 7 7 5 14 13 1 10 2 11 12 4 14 10 21 23 16 5 11 10 14 14 1 13 16 6 8 17 3 1 3 1 6 12 9 17 16 9 2 21 27 2 6 9 17 6 11 5 15 3 17 4 13 9 1 4 5 1...
output:
Case #1: 21 1 2 20 3 19 4 4 18 5 17 6 16 7 15 8 14 9 13 10 12 11 11 21 21 2 3 1 4 20 5 19 6 18 7 7 17 8 16 9 15 10 14 11 11 13 12 21 3 4 2 5 1 1 6 20 7 19 8 18 9 17 10 16 11 15 12 14 13 21 4 5 5 3 6 2 7 1 1 8 20 9 19 10 18 11 17 12 16 13 15 14 21 5 5 6 4 7 3 8 2 9 1 10 10 20 11 19 12 18 13 17 14 16 ...
result:
ok OK, 4700 cases
Test #13:
score: 0
Accepted
time: 53ms
memory: 3664kb
input:
2000 31 34 5 28 14 25 14 13 10 2 21 24 28 6 4 23 9 5 4 26 18 18 8 7 24 12 21 19 19 10 2 11 7 13 9 6 31 33 20 18 1 26 19 2 5 27 18 18 12 15 28 28 1 12 5 5 5 11 10 9 5 14 26 18 10 23 27 25 17 1 4 31 29 28 18 22 1 4 17 12 23 19 27 12 19 26 27 26 18 6 9 20 16 6 19 17 25 3 12 23 5 5 31 37 9 25 27 12 28 9...
output:
Case #1: 31 1 2 30 3 29 29 4 28 5 27 6 26 7 25 8 24 9 23 10 22 11 21 12 20 13 19 14 18 15 17 16 31 2 3 3 1 4 30 5 29 6 28 7 27 8 26 9 25 10 10 24 11 23 12 22 13 21 14 20 15 19 16 18 17 31 3 4 2 5 1 6 30 7 29 8 8 28 9 27 10 26 11 25 12 24 13 23 14 22 15 15 21 16 20 17 19 18 31 4 5 3 6 2 7 7 1 8 30 9 ...
result:
ok OK, 2000 cases
Test #14:
score: 0
Accepted
time: 54ms
memory: 3576kb
input:
780 51 55 2 9 14 17 31 21 36 21 16 40 32 9 25 5 48 1 25 6 38 13 14 47 2 33 38 42 37 30 35 24 44 22 28 39 6 9 13 47 34 34 19 24 11 10 29 14 6 40 42 18 33 12 18 9 3 51 57 36 31 7 48 37 19 8 35 30 15 41 5 16 27 17 14 42 38 9 42 48 44 4 5 46 1 24 41 1 14 38 35 14 29 36 8 8 21 19 7 25 44 43 1 32 24 7 11 ...
output:
Case #1: 51 1 2 2 50 3 49 4 48 5 47 6 46 46 7 45 8 44 9 43 10 42 11 41 12 40 13 39 39 14 38 15 37 16 36 17 35 18 34 19 33 20 32 21 31 22 22 30 23 29 24 28 25 27 26 51 2 3 1 4 50 5 49 6 48 7 47 8 46 9 45 10 44 11 43 12 42 13 13 41 14 40 15 39 16 38 17 37 18 36 19 35 20 34 21 33 22 32 23 31 31 24 30 2...
result:
ok OK, 780 cases
Test #15:
score: 0
Accepted
time: 58ms
memory: 3592kb
input:
198 101 103 54 54 28 16 56 42 72 79 61 77 67 38 33 96 82 79 2 58 88 43 14 61 70 55 14 58 60 62 63 52 82 79 43 47 49 3 28 80 57 88 55 89 57 50 95 84 58 40 49 13 7 78 11 12 48 21 54 93 9 97 61 66 29 81 97 8 38 3 85 67 84 27 85 76 42 37 28 23 48 25 29 3 71 31 17 41 36 79 26 54 12 92 94 54 53 35 37 19 3...
output:
Case #1: 101 1 2 100 3 99 4 98 5 97 6 96 7 95 8 94 9 93 10 92 11 91 12 90 13 89 14 88 15 87 16 86 17 85 18 84 19 83 20 82 21 81 22 80 23 79 24 78 25 77 26 76 27 75 28 28 74 29 73 30 72 31 71 32 70 33 69 34 68 35 67 36 66 37 65 38 64 39 63 40 62 41 61 42 60 43 59 44 58 45 57 46 56 47 55 48 54 49 53 5...
result:
ok OK, 198 cases
Test #16:
score: 0
Accepted
time: 58ms
memory: 3648kb
input:
8 499 525 114 220 79 338 377 103 342 3 46 404 13 272 375 131 31 325 354 168 294 378 363 68 104 463 346 360 435 461 276 151 431 405 303 436 349 398 323 172 404 87 194 111 162 179 399 312 13 393 82 149 67 135 88 472 381 9 388 238 448 163 422 113 143 19 311 461 11 263 158 337 479 450 135 47 492 64 8 26...
output:
Case #1: 499 1 2 498 3 497 4 496 5 495 6 494 7 493 8 492 9 491 10 490 11 489 12 488 13 487 14 486 15 485 16 484 17 483 18 482 19 481 20 480 21 479 22 478 23 477 24 476 25 475 26 474 27 473 28 472 29 471 30 470 31 469 32 468 33 467 34 466 35 465 36 464 37 463 38 462 39 461 40 460 41 459 42 458 43 457...
result:
ok OK, 8 cases
Test #17:
score: 0
Accepted
time: 55ms
memory: 3876kb
input:
2 999 1031 352 582 8 942 106 301 80 868 705 200 986 193 843 715 563 861 800 694 453 106 243 840 714 919 557 180 732 707 801 523 441 189 227 564 67 874 137 219 509 52 205 480 515 81 295 438 274 911 501 260 992 58 616 536 234 772 738 594 265 697 696 789 156 313 455 755 317 845 18 712 781 95 400 62 457...
output:
Case #1: 999 1 2 998 3 997 4 996 5 995 6 994 7 993 8 992 9 991 10 990 11 989 12 988 13 987 14 986 15 985 16 984 17 983 18 982 19 981 20 980 21 979 22 978 23 977 24 976 25 975 26 974 27 973 28 972 29 971 30 970 31 969 32 968 33 967 34 966 35 965 36 964 37 963 38 962 39 961 40 960 41 959 42 958 43 957...
result:
ok OK, 2 cases
Test #18:
score: 0
Accepted
time: 47ms
memory: 3820kb
input:
2 999 999 848 520 572 830 859 562 369 726 766 93 841 929 890 261 644 121 168 989 93 244 595 845 955 371 926 347 296 944 833 471 904 341 13 752 44 712 578 355 833 546 597 407 186 472 785 93 659 892 925 560 562 150 162 186 260 826 366 478 459 430 115 741 834 981 139 109 418 321 149 754 167 207 562 495...
output:
Case #1: 999 1 2 998 3 997 4 996 5 995 6 994 7 993 8 992 9 991 10 990 11 989 12 988 13 987 14 986 15 985 16 984 17 983 18 982 19 981 20 980 21 979 22 978 23 977 24 976 25 975 26 974 27 973 28 972 29 971 30 970 31 969 32 968 33 967 34 966 35 965 36 964 37 963 38 962 39 961 40 960 41 959 42 958 43 957...
result:
ok OK, 2 cases
Test #19:
score: 0
Accepted
time: 66ms
memory: 3636kb
input:
2 999 994 452 635 984 227 498 587 35 67 265 269 982 486 255 964 366 159 995 500 427 870 470 559 230 881 359 968 772 169 337 251 547 550 627 7 255 158 919 638 303 132 397 330 406 944 494 748 528 29 323 254 102 22 8 345 762 434 700 48 687 536 740 88 478 746 576 854 917 384 958 338 643 351 314 393 515 ...
output:
Case #1: 999 1 2 998 3 997 4 996 5 995 6 994 7 993 8 992 9 991 10 990 11 989 12 988 13 987 14 986 15 985 16 984 17 983 18 982 19 981 20 980 21 979 22 978 23 977 24 976 25 975 26 974 27 973 28 972 29 971 30 970 31 969 32 968 33 967 34 966 35 965 36 964 37 963 38 962 39 961 40 960 41 959 42 958 43 957...
result:
ok OK, 2 cases
Test #20:
score: 0
Accepted
time: 31ms
memory: 3596kb
input:
20000 9 11 3 2 2 5 1 5 4 4 3 4 3 5 6 1 2 2 2 1 2 9 12 6 1 1 2 1 6 6 3 5 2 1 2 9 12 5 2 6 4 1 1 6 1 2 1 5 2 7 10 2 1 2 3 1 4 2 4 1 1 7 9 3 2 2 3 1 2 1 4 3 5 8 1 2 2 1 1 1 1 1 7 8 2 2 3 4 3 4 2 1 5 7 2 1 1 1 2 2 1 7 9 2 2 3 4 3 2 2 2 1 5 6 2 2 1 2 2 1 5 6 2 1 1 2 2 2 5 7 2 1 1 2 2 1 1 9 11 5 6 3 5 2 2...
output:
Case #1: 9 1 2 8 8 3 7 7 4 6 6 5 9 2 3 1 1 4 4 8 5 7 6 9 9 3 4 2 5 5 1 6 8 7 7 9 4 5 5 3 6 2 7 7 1 8 9 Case #2: 5 1 1 2 4 4 3 5 5 2 3 3 1 1 4 5 Case #3: 9 1 2 8 3 7 4 4 6 6 5 5 9 2 2 3 3 1 4 8 5 7 6 6 9 3 4 2 5 1 1 6 8 7 7 9 4 5 3 6 6 2 7 7 1 1 8 9 Case #4: 9 1 2 8 3 7 7 4 6 6 5 9 2 3 1 4 4 8 5 7 6 ...
result:
ok OK, 20000 cases
Test #21:
score: 0
Accepted
time: 26ms
memory: 3560kb
input:
5000 13 12 5 8 9 7 5 4 10 10 7 9 2 2 7 13 2 2 1 2 2 2 3 1 1 1 2 1 1 11 16 1 1 5 4 6 2 5 1 5 8 1 1 7 3 4 1 13 17 4 1 9 1 8 1 7 6 4 8 2 8 5 8 4 1 1 5 6 1 2 1 2 2 2 9 9 5 4 5 4 5 1 6 1 5 17 23 4 9 1 10 5 8 8 7 4 11 2 4 6 3 6 7 11 3 10 7 4 5 1 13 14 10 9 1 1 1 10 3 8 8 10 3 3 10 1 7 8 4 1 4 1 4 3 2 2 19...
output:
Case #1: 13 1 2 12 3 11 11 4 10 5 9 6 8 7 13 13 2 3 1 4 12 5 11 6 10 10 7 9 8 13 3 4 2 2 5 1 6 12 7 7 11 8 10 9 9 13 4 5 3 6 2 7 1 8 12 12 9 11 10 13 5 6 4 7 3 8 8 2 9 1 10 12 11 13 13 6 7 5 8 4 9 3 10 2 2 11 1 1 12 13 Case #2: 7 1 2 2 6 3 3 5 5 4 7 7 2 3 3 1 4 4 6 5 7 7 3 3 4 4 2 2 5 1 1 6 6 7 Case...
result:
ok OK, 5000 cases
Test #22:
score: 0
Accepted
time: 11ms
memory: 3668kb
input:
2000 27 44 5 15 4 6 7 14 9 2 1 24 9 4 12 6 13 23 7 3 21 2 5 2 3 20 8 12 10 21 3 1 6 8 8 4 5 3 19 1 10 7 4 1 1 2 29 31 25 8 18 22 7 7 25 9 26 25 6 11 20 1 7 9 11 14 23 20 1 13 16 1 22 23 14 6 13 1 2 27 27 16 24 6 12 3 3 22 2 24 12 6 10 18 14 8 21 20 14 15 4 23 20 2 14 11 23 4 29 39 15 19 3 7 1 13 20 ...
output:
Case #1: 27 1 2 26 3 25 25 4 24 5 23 6 22 7 21 8 20 9 19 10 18 11 11 17 12 16 13 13 15 14 27 2 3 1 1 4 26 5 25 6 24 7 7 23 8 22 9 21 10 20 11 19 12 18 13 17 14 14 16 15 27 3 4 2 5 1 6 6 26 7 7 25 25 8 24 9 23 10 22 11 21 12 20 13 19 14 18 15 17 16 27 4 5 3 6 2 7 7 1 8 26 9 25 10 24 11 23 23 12 22 13...
result:
ok OK, 2000 cases
Test #23:
score: 0
Accepted
time: 24ms
memory: 3528kb
input:
800 9 11 5 5 4 1 1 5 5 6 2 1 1 11 14 5 7 5 1 3 3 6 8 3 7 2 3 1 1 19 22 14 10 8 2 9 12 13 2 6 5 8 5 5 1 12 1 10 13 10 2 14 9 9 9 6 5 3 4 3 4 4 6 1 5 7 2 1 1 2 1 2 1 5 7 1 2 2 2 1 1 1 31 29 20 8 18 13 1 24 12 9 12 19 24 25 21 23 6 27 12 10 17 19 23 26 23 5 28 14 11 2 13 49 48 42 46 45 12 5 24 16 28 40...
output:
Case #1: 9 1 2 8 3 7 7 4 6 5 9 2 2 3 1 4 8 8 5 5 7 7 6 9 3 4 2 2 5 1 6 8 7 7 9 4 5 3 6 2 2 7 1 1 8 8 9 Case #2: 11 1 2 10 3 9 9 4 8 5 7 6 11 2 2 3 1 4 10 5 5 9 9 6 8 7 7 11 3 4 4 2 5 1 6 10 7 7 9 8 11 4 5 3 6 2 2 7 1 8 8 10 9 11 5 6 4 7 7 3 8 8 2 9 1 1 10 10 11 Case #3: 19 1 2 18 3 17 4 16 5 15 6 14...
result:
ok OK, 800 cases
Test #24:
score: 0
Accepted
time: 23ms
memory: 3640kb
input:
200 23 26 6 17 15 16 8 5 3 20 8 17 16 8 10 10 10 10 14 1 16 12 7 6 2 4 10 2 47 45 40 15 13 24 37 4 37 8 27 44 12 11 38 19 41 26 22 33 13 26 20 40 39 37 21 16 32 14 9 8 32 36 43 28 29 4 26 38 23 34 5 23 17 16 1 11 12 4 6 7 7 8 4 8 3 1 2 3 2 89 89 57 9 68 20 45 8 78 59 16 83 72 8 42 39 76 76 28 72 46 ...
output:
Case #1: 23 1 2 22 3 21 4 4 20 5 19 6 18 7 17 8 16 9 15 10 14 11 13 12 23 23 2 3 1 4 22 5 21 6 20 7 19 8 18 9 17 17 10 16 11 15 12 14 13 23 3 4 2 5 1 6 22 7 7 21 8 20 9 19 10 18 11 11 17 12 16 13 15 15 14 23 4 4 5 3 6 2 7 1 8 22 9 21 10 20 11 19 12 18 13 17 14 16 16 15 23 5 6 4 7 3 8 8 2 9 1 10 22 1...
result:
ok OK, 200 cases
Test #25:
score: 0
Accepted
time: 17ms
memory: 3872kb
input:
8 123 123 11 68 57 31 101 57 58 24 104 69 103 1 3 32 74 103 13 86 90 112 64 109 25 68 60 102 89 50 112 37 53 93 24 115 93 21 56 82 80 13 71 54 94 16 6 57 20 39 54 76 48 57 75 35 63 11 86 102 32 20 65 15 81 15 98 14 102 57 92 94 46 104 56 60 57 120 31 114 23 111 15 96 68 93 50 26 114 79 103 59 106 60...
output:
Case #1: 123 1 2 122 3 121 4 120 5 119 6 118 118 7 117 8 116 9 115 10 114 11 113 12 112 13 111 14 110 15 109 16 108 17 107 18 106 19 105 20 104 21 103 22 102 23 101 24 100 25 99 26 98 27 97 28 96 29 95 30 94 31 93 32 92 33 91 34 90 35 89 36 88 37 87 38 86 39 85 40 84 84 41 83 42 82 43 81 44 80 45 79...
result:
ok OK, 8 cases
Test #26:
score: 0
Accepted
time: 37ms
memory: 3640kb
input:
2 931 941 37 625 158 286 652 892 205 242 367 627 914 33 501 700 280 117 693 593 389 547 807 758 160 565 24 601 784 551 322 749 463 504 681 221 8 857 511 554 45 797 828 538 779 876 868 475 607 43 161 692 514 687 717 420 610 570 389 112 587 551 890 101 128 371 621 186 263 926 332 130 21 898 311 436 32...
output:
Case #1: 931 1 2 930 3 929 4 928 5 927 6 926 7 925 8 924 9 923 10 922 11 921 12 920 13 919 14 918 15 917 16 916 17 915 18 914 19 913 913 20 912 21 911 22 910 23 909 24 908 25 907 26 906 27 905 28 904 29 903 30 902 31 901 32 900 33 899 34 898 35 897 36 896 37 895 38 894 39 893 40 892 41 891 42 890 43...
result:
ok OK, 2 cases
Test #27:
score: 0
Accepted
time: 8ms
memory: 3824kb
input:
2 57 60 24 19 36 48 4 43 19 52 8 52 6 17 10 19 18 41 20 36 4 41 38 34 24 26 29 48 15 37 10 7 4 8 16 43 8 9 27 38 12 19 52 31 9 54 49 15 51 24 43 54 29 46 12 40 17 36 50 12 2 1 643 646 230 5 469 246 610 243 221 411 352 98 56 243 481 622 240 492 349 336 548 102 516 326 468 563 272 363 99 156 468 562 5...
output:
Case #1: 57 1 2 56 3 55 4 54 5 53 6 52 7 51 8 50 9 49 10 48 11 47 12 46 13 13 45 14 44 15 43 16 42 17 41 18 40 19 39 20 38 21 37 22 36 36 23 35 24 34 25 33 26 32 27 31 28 30 29 57 2 3 1 4 56 5 55 6 54 7 53 8 52 9 51 10 50 11 49 12 48 13 13 47 14 46 15 45 16 44 17 43 18 42 19 41 20 40 21 39 22 38 23 ...
result:
ok OK, 2 cases
Test #28:
score: 0
Accepted
time: 27ms
memory: 3664kb
input:
2 939 935 96 887 857 430 351 403 292 594 392 287 841 710 428 591 389 218 248 134 924 445 162 52 491 820 314 711 207 112 874 201 908 448 799 207 6 690 782 141 749 623 628 466 495 700 861 588 791 93 364 36 834 772 774 619 615 46 358 5 493 382 121 891 71 564 219 201 496 495 883 781 546 394 548 936 643 ...
output:
Case #1: 939 1 2 938 3 937 4 936 5 935 6 934 7 933 8 932 9 931 10 930 11 929 12 928 13 927 14 926 15 925 16 924 17 923 18 922 19 921 20 920 21 919 22 918 23 917 24 916 25 915 26 914 27 913 28 912 29 911 30 910 31 909 32 908 33 907 34 906 35 905 36 904 37 903 38 902 39 901 40 900 41 899 42 898 43 897...
result:
ok OK, 2 cases
Test #29:
score: 0
Accepted
time: 38ms
memory: 3640kb
input:
2 763 776 379 463 566 538 49 15 664 613 227 59 631 331 374 87 4 325 559 80 459 107 528 340 427 420 99 171 492 465 572 316 723 598 423 135 14 156 604 99 648 509 657 449 715 50 157 652 701 521 644 529 420 385 173 55 758 649 311 135 744 47 370 488 40 405 722 284 443 676 57 552 283 241 26 449 522 201 10...
output:
Case #1: 763 1 2 762 3 761 4 760 5 759 6 758 7 757 8 756 9 755 10 754 11 753 12 752 13 751 14 750 15 749 16 748 17 747 18 746 19 745 20 744 21 743 22 742 23 741 24 740 25 739 26 738 27 737 28 736 29 735 30 734 31 733 32 732 33 731 34 730 35 729 36 728 37 727 38 726 39 725 40 724 41 723 42 722 43 721...
result:
ok OK, 2 cases
Test #30:
score: 0
Accepted
time: 56ms
memory: 3644kb
input:
2 999 504 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 991 99...
output:
Case #1: 999 1 2 998 3 997 4 996 5 995 6 994 7 993 8 992 9 991 10 990 11 989 12 988 13 987 14 986 15 985 16 984 17 983 18 982 19 981 20 980 21 979 22 978 23 977 24 976 25 975 26 974 27 973 28 972 29 971 30 970 31 969 32 968 33 967 34 966 35 965 36 964 37 963 38 962 39 961 40 960 41 959 42 958 43 957...
result:
ok OK, 2 cases
Test #31:
score: 0
Accepted
time: 50ms
memory: 3664kb
input:
2 999 501 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 996 99...
output:
Case #1: 999 1 2 998 3 997 4 996 5 995 6 994 7 993 8 992 9 991 10 990 11 989 12 988 13 987 14 986 15 985 16 984 17 983 18 982 19 981 20 980 21 979 22 978 23 977 24 976 25 975 26 974 27 973 28 972 29 971 30 970 31 969 32 968 33 967 34 966 35 965 36 964 37 963 38 962 39 961 40 960 41 959 42 958 43 957...
result:
ok OK, 2 cases
Test #32:
score: 0
Accepted
time: 33ms
memory: 3656kb
input:
20000 9 11 3 2 2 5 1 5 4 4 3 4 3 5 6 1 2 2 2 1 2 9 12 6 1 1 2 1 6 6 3 5 2 1 2 9 12 5 2 6 4 1 1 6 1 2 1 5 2 7 10 2 1 2 3 1 4 2 4 1 1 7 9 3 2 2 3 1 2 1 4 3 5 8 1 2 2 1 1 1 1 1 7 8 2 2 3 4 3 4 2 1 5 7 2 1 1 1 2 2 1 7 9 2 2 3 4 3 2 2 2 1 5 6 2 2 1 2 2 1 5 6 2 1 1 2 2 2 5 7 2 1 1 2 2 1 1 9 11 5 6 3 5 2 2...
output:
Case #1: 9 1 2 8 8 3 7 7 4 6 6 5 9 2 3 1 1 4 4 8 5 7 6 9 9 3 4 2 5 5 1 6 8 7 7 9 4 5 5 3 6 2 7 7 1 8 9 Case #2: 5 1 1 2 4 4 3 5 5 2 3 3 1 1 4 5 Case #3: 9 1 2 8 3 7 4 4 6 6 5 5 9 2 2 3 3 1 4 8 5 7 6 6 9 3 4 2 5 1 1 6 8 7 7 9 4 5 3 6 6 2 7 7 1 1 8 9 Case #4: 9 1 2 8 3 7 7 4 6 6 5 9 2 3 1 4 4 8 5 7 6 ...
result:
ok OK, 20000 cases
Test #33:
score: 0
Accepted
time: 245ms
memory: 3600kb
input:
18968 51 55 2 9 14 17 31 21 36 21 16 40 32 9 25 5 48 1 25 6 38 13 14 47 2 33 38 42 37 30 35 24 44 22 28 39 6 9 13 47 34 34 19 24 11 10 29 14 6 40 42 18 33 12 18 9 3 51 57 36 31 7 48 37 19 8 35 30 15 41 5 16 27 17 14 42 38 9 42 48 44 4 5 46 1 24 41 1 14 38 35 14 29 36 8 8 21 19 7 25 44 43 1 32 24 7 1...
output:
Case #1: 51 1 2 2 50 3 49 4 48 5 47 6 46 46 7 45 8 44 9 43 10 42 11 41 12 40 13 39 39 14 38 15 37 16 36 17 35 18 34 19 33 20 32 21 31 22 22 30 23 29 24 28 25 27 26 51 2 3 1 4 50 5 49 6 48 7 47 8 46 9 45 10 44 11 43 12 42 13 13 41 14 40 15 39 16 38 17 37 18 36 19 35 20 34 21 33 22 32 23 31 31 24 30 2...
result:
ok OK, 18968 cases