QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#250740 | #7729. Permutation Compression II | supepapupu | AC ✓ | 179ms | 24540kb | C++17 | 1.8kb | 2023-11-13 16:40:43 | 2023-11-13 16:40:43 |
Judging History
answer
#include <bits/stdc++.h>
#define x first
#define y second
#define el '\n'
#define debug(x) cout << #x << ": " << x << el
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int N = 3e5 + 10, INF = 0x3f3f3f3f, mod = 10007;
int lis(vector<int> a) {
int n = a.size(), len = 0;
vector<int> f(n + 1);
for (int i = 0; i < n; ++i) {
int l = 0, r = len, mid;
while (l < r) {
mid = l + r + 1 >> 1;
if (f[mid] < a[i]) l = mid;
else r = mid - 1;
}
len = max(len, r + 1);
f[r + 1] = a[i];
}
return len;
}
void solve() {
int n; cin >> n;
vector<int> a(n + 1), p(n + 1);
for (int i = 1; i <= n; ++i) cin >> a[i], p[a[i]] = i;
vector<int> f(n + 1, INF), pre(n + 1);
int len = 0;
for (int i = 1; i <= n; ++i) {
int l = 0, r = len, mid;
while (l < r) {
mid = l + r + 1 >> 1;
if (f[mid] < p[i]) l = mid;
else r = mid - 1;
}
len = max(len, r + 1);
if (f[r] != INF) pre[i] = a[f[r]];
f[r + 1] = p[i];
}
cout << len << ' ';
vector<bool> need(n + 1);
int now = a[f[len]];
while (now) {
need[p[now]] = 1;
now = pre[now];
}
priority_queue<int> del;
for (int i = n, lim = INF; i; --i) {
if (need[i]) lim = min(lim, a[i]);
else if (a[i] > lim) del.push(a[i]);
}
cout << del.size() << el;
while (del.size()) {
int t = del.top(); del.pop();
cout << p[t] << ' ';
}
cout << el;
}
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int tcase = 1;
cin >> tcase;
while (tcase--) solve();
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3360kb
input:
2 3 3 1 2 3 1 2 3
output:
2 1 1 3 0
result:
ok ok n = 3
Test #2:
score: 0
Accepted
time: 94ms
memory: 3456kb
input:
100000 7 2 6 7 1 4 3 5 6 1 5 6 3 2 4 3 1 2 3 3 2 1 3 14 9 6 13 10 4 7 5 14 1 12 8 3 2 11 3 1 2 3 14 1 9 3 14 5 7 4 6 12 2 8 11 13 10 8 7 1 3 6 2 5 8 4 16 9 3 4 8 7 16 10 6 11 1 14 2 13 12 5 15 3 3 1 2 33 9 10 23 3 16 1 19 32 25 4 5 31 28 7 22 27 30 8 6 17 2 14 13 29 20 33 26 18 24 11 12 15 21 2 2 1 ...
output:
3 0 3 0 3 0 2 0 4 5 8 3 10 4 1 3 0 7 3 4 9 2 4 1 1 7 2 6 1 2 1 1 9 21 26 8 12 17 24 13 16 27 9 29 3 15 25 7 28 20 5 22 23 2 1 1 0 2 0 1 0 2 0 5 5 6 3 5 2 7 2 0 6 3 11 3 4 3 0 2 0 5 3 4 3 1 1 0 3 1 1 2 0 4 3 1 4 2 10 19 12 25 8 31 27 4 16 15 17 1 20 22 28 9 32 13 10 11 14 2 ...
result:
ok ok n = 8
Test #3:
score: 0
Accepted
time: 93ms
memory: 3520kb
input:
10000 65 4 18 41 7 11 24 29 19 12 52 65 2 62 5 37 55 59 20 42 1 47 54 32 16 58 14 9 26 61 3 15 33 27 35 50 21 8 48 51 23 10 13 17 44 60 46 56 38 36 53 39 25 31 28 49 40 64 22 34 63 57 30 6 43 45 123 8 75 110 89 30 47 80 87 34 66 50 36 44 12 20 27 55 58 39 67 11 109 114 17 116 5 10 21 86 112 123 93 2...
output:
13 25 11 57 60 13 29 45 17 25 61 47 16 22 50 10 39 35 55 38 21 46 44 19 3 15 2 22 38 31 46 101 59 53 37 25 23 41 30 45 3 22 48 55 38 82 40 86 42 32 4 8 29 70 64 7 34 2 36 20 10 49 18 17 11 6 13 21 24 81 73 13 14 66 78 47 10 22 35 5 55 65 27 34 36 4 39 11 30 19 3 6 8 36 141 343 292 226 211 158 283...
result:
ok ok n = 35
Test #4:
score: 0
Accepted
time: 117ms
memory: 3620kb
input:
1000 755 225 379 544 576 667 603 358 368 689 711 406 681 393 651 18 244 354 114 157 559 490 599 621 537 356 351 113 166 380 169 605 289 106 409 574 124 1 228 515 545 293 170 212 306 412 435 648 459 694 660 258 267 411 181 594 439 25 607 588 560 369 32 259 699 223 464 606 563 747 592 344 663 693 529 ...
output:
49 286 206 124 499 228 638 257 181 458 69 191 213 702 186 544 309 477 451 352 600 253 508 244 347 539 120 149 440 193 95 466 337 495 300 595 706 449 264 647 323 105 10 247 435 426 576 584 296 218 208 651 126 443 64 424 203 644 49 73 533 676 384 9 671 192 674 224 342 98 12 518 115 200 587 113 491 375...
result:
ok ok n = 1038
Test #5:
score: 0
Accepted
time: 138ms
memory: 3840kb
input:
100 9934 5959 6367 4621 2806 5929 6657 7409 1773 206 4002 8297 7782 3544 1605 6282 7405 9175 3939 9739 3540 7920 3252 8382 2848 5874 7175 4951 8598 5101 1142 4451 7386 8279 2200 8870 7550 2195 5797 928 5601 6488 2127 167 9277 448 5495 9475 5048 4236 7279 1144 6702 8405 1116 282 8597 1317 219 4976 80...
output:
193 4811 9003 7079 7525 8150 4652 8955 8531 2427 3279 5770 3108 6227 8521 1496 6724 3770 6524 4301 4114 3881 2317 7080 425 7175 2484 2431 5536 847 1542 9363 4006 6877 2931 6659 3552 7510 473 7442 303 6665 1234 8087 5127 6770 410 5060 4501 1032 232 8247 807 9012 542 8478 113 2543 5445 5111 5857 536 3...
result:
ok ok n = 3558
Test #6:
score: 0
Accepted
time: 149ms
memory: 9044kb
input:
10 16046 15112 9938 7990 507 10378 9653 3934 483 6732 13907 4660 8592 4845 7396 4829 6228 14079 1583 8493 1692 981 1466 12874 12410 12924 7050 3376 12376 2460 6776 4551 4507 3266 13348 10515 4216 2324 14355 14681 6301 7510 6027 4532 6303 7315 6277 4689 12677 7569 9873 5108 8486 15572 15446 7226 1175...
output:
253 8125 4534 14283 12967 5280 12462 8991 15872 1043 13051 1842 3120 7875 14757 15560 13426 10744 574 6190 4485 8254 4372 11322 7069 591 1001 12173 8375 6958 14580 7869 5188 11403 4307 5627 6504 3030 14465 9953 12132 2936 5097 7973 6768 844 9867 129 14157 8532 11383 3787 11488 9653 10201 12411 14084...
result:
ok ok n = 83294
Test #7:
score: 0
Accepted
time: 179ms
memory: 20896kb
input:
1 1000000 330652 360403 666390 110925 197675 937862 536868 187911 88303 970828 421775 501768 79595 76239 644124 256083 662395 363691 240456 406463 90594 392030 969653 31799 577337 694817 841968 74013 67730 297531 454629 965693 577789 79111 588020 710557 186930 454320 876010 344009 273600 589241 6482...
output:
2001 499039 887455 843034 606750 274452 990709 714800 798945 309639 977360 54315 940618 591634 350873 814540 275767 34953 316754 135398 177553 349814 323613 333963 456298 303093 722037 742174 540157 559209 894756 62985 65880 216143 153746 322898 333785 387940 219322 347269 466531 46359 324628 382542...
result:
ok ok n = 1000000
Test #8:
score: 0
Accepted
time: 64ms
memory: 18860kb
input:
1 1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
999994 3 826499 39929 589259
result:
ok ok n = 1000000
Test #9:
score: 0
Accepted
time: 125ms
memory: 24540kb
input:
1 1000000 1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 99...
output:
5 684511 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...
result:
ok ok n = 1000000
Test #10:
score: 0
Accepted
time: 61ms
memory: 18912kb
input:
1 1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
999990 5 297490 756107 555780 8244 118552
result:
ok ok n = 1000000
Test #11:
score: 0
Accepted
time: 89ms
memory: 20924kb
input:
1 1000000 1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 99...
output:
5 363938 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...
result:
ok ok n = 1000000
Test #12:
score: 0
Accepted
time: 58ms
memory: 18956kb
input:
1 1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
999980 10 167859 298987 261994 727832 41129 29479 374454 418385 344188 180924
result:
ok ok n = 1000000
Test #13:
score: 0
Accepted
time: 80ms
memory: 20944kb
input:
1 1000000 1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 99...
output:
9 273978 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...
result:
ok ok n = 1000000
Test #14:
score: 0
Accepted
time: 54ms
memory: 18836kb
input:
1 1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
999800 100 142042 607055 651958 97844 620058 649454 535912 77331 556689 697162 500448 238597 5453 399957 868066 627883 733459 25031 530736 91201 186661 203186 758509 244816 798157 109691 223326 277881 206866 139624 71604 2908 743869 409126 91316 333930 618305 647807 375256 259947 78578 374674 377376...
result:
ok ok n = 1000000
Test #15:
score: 0
Accepted
time: 74ms
memory: 19856kb
input:
1 1000000 1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 99...
output:
27 253628 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
result:
ok ok n = 1000000
Test #16:
score: 0
Accepted
time: 65ms
memory: 18864kb
input:
1 1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
998002 999 550683 30662 981760 746773 920689 361781 909758 936992 276945 483260 395859 78743 704934 478106 973722 827611 451996 19685 440886 356349 723295 560370 820582 764762 164369 244134 856455 94526 8997 746555 711499 308995 445258 345705 290310 483109 244391 621756 150010 385421 78005 321147 21...
result:
ok ok n = 1000000
Test #17:
score: 0
Accepted
time: 88ms
memory: 20932kb
input:
1 1000000 1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 99...
output:
85 389238 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
result:
ok ok n = 1000000
Test #18:
score: 0
Accepted
time: 68ms
memory: 18900kb
input:
1 1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
980209 9897 413352 785748 348591 324893 114109 900364 297980 942287 650720 532241 449072 621549 351096 301690 924204 32392 98974 589277 936610 32996 263321 516871 262699 548531 869116 490457 619656 969936 945330 132370 164591 625537 809189 166834 42809 590387 126495 136489 239121 935330 594418 14304...
result:
ok ok n = 1000000
Test #19:
score: 0
Accepted
time: 98ms
memory: 20988kb
input:
1 1000000 1000000 999999 999998 999997 999996 999995 999994 999993 999992 999991 999990 999989 999988 999987 999986 999985 999984 999983 999982 999981 999980 999979 999978 999977 999976 999975 999974 999973 999972 999971 999970 999969 999968 999967 999966 999965 999964 999963 999962 999961 999960 99...
output:
273 444546 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 823252 ...
result:
ok ok n = 1000000
Test #20:
score: 0
Accepted
time: 61ms
memory: 18940kb
input:
1 1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 10...
output:
1000000 0
result:
ok ok n = 1000000
Test #21:
score: 0
Accepted
time: 56ms
memory: 18636kb
input:
2 14602 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
14596 3 7571 11569 5925 985392 3 6724 80509 295414
result:
ok ok n = 985398
Test #22:
score: 0
Accepted
time: 77ms
memory: 15448kb
input:
3 221862 221862 221861 221860 221859 221858 221857 221856 221855 221854 221853 221852 221851 221850 221849 221848 221847 221846 221845 221844 221843 221842 221841 221840 221839 221838 221837 221836 221835 221834 221833 221832 221831 221830 221829 221828 221827 221826 221825 221824 221823 221822 2218...
output:
5 46880 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
result:
ok ok n = 665566
Test #23:
score: 0
Accepted
time: 51ms
memory: 12412kb
input:
4 69450 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
69440 5 14216 14055 11937 14310 641 35372 5 6268 7482 1985 5677 6882 571814 5 110932 419295 75911 159234 88402 323334 5 1879 12841 114039 17027 57740
result:
ok ok n = 323344
Test #24:
score: 0
Accepted
time: 78ms
memory: 16128kb
input:
5 1278 1278 1277 1276 1275 1274 1273 1272 1271 1270 1269 1268 1267 1266 1265 1264 1263 1262 1261 1260 1259 1258 1257 1256 1255 1254 1253 1252 1251 1250 1249 1248 1247 1246 1245 1244 1243 1242 1241 1240 1239 1238 1237 1236 1235 1234 1233 1232 1231 1230 1229 1228 1227 1226 1225 1224 1223 1222 1173 122...
output:
5 933 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 106 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
result:
ok ok n = 64361
Test #25:
score: 0
Accepted
time: 48ms
memory: 9568kb
input:
6 72201 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
72181 10 37862 34960 2433 29714 27189 9108 35321 3915 27234 21770 93085 10 34034 88114 74665 27507 1819 10252 60150 20086 45758 18710 415194 10 357128 260163 7140 172108 45388 80037 110905 178463 98954 17937 16440 10 4691 14944 9448 8645 4437 7010 1737 9665 3584 1876 179365 10 20695 4969 119985 ...
result:
ok ok n = 223635
Test #26:
score: 0
Accepted
time: 90ms
memory: 11200kb
input:
7 32589 32589 32588 32587 32586 32585 32584 32583 32582 32581 32580 32579 32578 32577 32576 32575 32574 32573 32572 32571 32570 32569 32568 32567 32566 32565 32564 32563 32562 32561 32560 32559 32558 32557 32556 32555 32554 32553 32552 32551 32550 32549 32548 32547 32546 32545 32544 32543 32542 3254...
output:
9 9820 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
result:
ok ok n = 4233
Test #27:
score: 0
Accepted
time: 57ms
memory: 7472kb
input:
10 34116 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 21997 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
33916 100 7037 11563 20146 3127 18670 18528 17002 25205 22685 26472 30461 18504 3508 30423 22559 17180 18310 17866 16121 19995 16490 12113 17265 3428 29246 10756 26993 3703 3601 10401 213 17811 21636 23413 13302 6757 14843 20712 27562 12588 13934 1873 5971 1606 6422 23275 2322 2088 4095 8603 5620 12...
result:
ok ok n = 24477
Test #28:
score: 0
Accepted
time: 84ms
memory: 6984kb
input:
20 95367 95367 95366 4319 95364 95363 95362 95361 95360 95359 95358 95357 95356 95355 95354 95353 95352 95351 95350 95349 95348 95347 95346 95345 95344 95343 95342 95341 95340 95339 95338 95337 95336 95335 95334 95333 95332 95331 95330 95329 95328 95327 95326 95325 95324 95323 95322 95321 95320 9531...
output:
33 24888 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
result:
ok ok n = 95529
Test #29:
score: 0
Accepted
time: 54ms
memory: 4612kb
input:
30 61430 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 58332 42 43 44 45 46 47 48 49 50 51 52 53 17021 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 35492 92 93 94 95 96 97 ...
output:
59466 986 38686 48528 47387 4418 4344 19212 45769 29015 39260 27632 4617 16019 8356 5431 57829 41823 51838 30824 10274 24570 13326 29434 43877 46075 33435 11898 16626 53967 57700 37324 59456 52256 25968 45462 42221 14591 57347 43603 46284 35887 3775 19426 38261 14582 30762 20801 32071 7000 51691 256...
result:
ok ok n = 3041
Test #30:
score: 0
Accepted
time: 109ms
memory: 16856kb
input:
2 344577 344577 344576 344575 344574 344573 344572 344571 344570 344569 344568 159183 344566 344565 344564 344563 344562 344561 344560 344559 344558 344557 344556 344555 344554 344553 344552 344551 344550 344549 344548 344547 344546 344545 344544 344543 344542 344541 344540 344539 344538 344537 2266...
output:
90 175296 1 2 3 4 5 6 7 8 9 10 185395 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 321913 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 ...
result:
ok ok n = 655423
Test #31:
score: 0
Accepted
time: 66ms
memory: 14356kb
input:
2 294769 1 2 3 4 5 6 7 8 233407 233310 11 289896 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 153307 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 254806 68634 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 65380 79 80 81 82 83 84 85 86 87 88 89 113089...
output:
275420 9685 27904 50738 85838 164566 110202 84176 254355 195980 264498 180782 192794 189193 141354 78884 45387 144770 169183 58154 57673 131884 156467 214014 249146 125750 69870 13475 227972 235897 231507 57773 35516 122052 225537 46754 175645 227607 76173 241545 119601 115285 55902 95697 214031 471...
result:
ok ok n = 705231
Test #32:
score: 0
Accepted
time: 110ms
memory: 16496kb
input:
3 217657 194137 217656 217655 217654 217653 217652 217651 217650 217649 217648 217647 217646 217645 217644 217643 217642 217641 217640 217639 217638 217637 217636 217635 217634 157715 217632 217631 217630 217629 217628 217627 217626 217625 217624 217623 217622 217621 217620 141420 151086 217617 2176...
output:
268 76851 23521 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 59943 26 27 28 29 30 31 32 33 34 35 36 37 38 76238 66572 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 56525 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 36815 78 79 73069 81 82 83 84 85 86 87 88 89 90 91 92 9...
result:
ok ok n = 131949
Test #33:
score: 0
Accepted
time: 58ms
memory: 12564kb
input:
3 8366 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
8366 0 393291 0 598343 0
result:
ok ok n = 598343
Extra Test:
score: 0
Extra Test Passed