QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#227898 | #7616. Jump Graph | sumi007 | AC ✓ | 304ms | 118472kb | C++14 | 2.4kb | 2023-10-28 08:42:00 | 2023-10-28 08:42:00 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define i64 __int128
#define ll long long
#define pb push_back
#define fi first
#define se second
#define pii pair<int,int>
#define lowbit(i) i&(-i)
const int N = 3e5+5;
int n,p[N],fa[N],l[N],r[N],maxx[N][20],pos[N][20];
ll xs[N],ans[N],siz[N],dep[N];
ll val[N*4];
stack<int> stk;
vector<int> e[N];
int ask(int l,int r){
int k = log2(r-l+1);
if(maxx[l][k]>maxx[r-(1<<k)+1][k]) return pos[l][k];
else return pos[r-(1<<k)+1][k];
}
void update(int l,int r,int u,int sl,int sr,ll w){
if(l>sr || sl>r) return ;
if(sl<=l && r<=sr){
val[u] += w;
return ;
}
int mid = (l+r)>>1;
update(l,mid,u*2,sl,sr,w);
update(mid+1,r,u*2+1,sl,sr,w);
}
ll ask(int l,int r,int u,int p){
if(l==r) return val[u];
ll res = val[u];
int mid = (l+r)>>1;
if(p<=mid) res += ask(l,mid,u*2,p);
else res += ask(mid+1,r,u*2+1,p);
return res;
}
void dfs(int u){
siz[u] = 1,xs[u] += dep[u];
for(int v:e[u]){
dep[v] = dep[u]+1;
dfs(v);
xs[u] += xs[v];
siz[u] += siz[v];
}
update(1,n,1,l[u],u-1,1);
update(1,n,1,u+1,r[u],1);
if(fa[u]!=u){
int l1=l[fa[u]],r1=l[u]-1,l2=r[u]+1,r2=r[fa[u]];
ll w = xs[u]-1ll*dep[fa[u]]*siz[u]+siz[u];
// cout << l1 << ' ' << r1 << ' ' << l2 << ' ' << r2 << " " << w << '\n';
update(1,n,1,l1,r1,w);
update(1,n,1,l2,r2,w);
}
}
int main(){
cin.tie(0),cout.tie(0);
ios::sync_with_stdio(0);
cin >> n;
for(int i=1;i<=n;i++) cin >> p[i],maxx[i][0] = p[i],pos[i][0] = i;
for(int i=1;i<=n;i++){
l[i] = 1,r[i] = n;
while(stk.size() && p[stk.top()]<p[i]) r[stk.top()] = i,stk.pop();
if(stk.size()) l[i] = stk.top();
stk.push(i);
}
for(int i=1;i<=19;i++){
for(int j=1;j+(1<<(i-1))<=n;j++){
// minn[j][i] = min(minn[j][i-1],minn[j+(1<<(i-1))][i-1]);
if(maxx[j][i-1]>maxx[j+(1<<(i-1))][i-1]) maxx[j][i] = maxx[j][i-1],pos[j][i] = pos[j][i-1];
else maxx[j][i] = maxx[j+(1<<(i-1))][i-1],pos[j][i] = pos[j+(1<<(i-1))][i-1];
}
}
for(int i=1;i<=n;i++) fa[i] = ask(l[i],r[i]);
for(int i=1;i<=n;i++) if(fa[i]!=i) e[fa[i]].pb(i);
for(int i=1;i<=n;i++) if(fa[i]==i) dfs(i);
for(int i=1;i<=n;i++) cout << ask(1,n,1,i) << " ";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 24700kb
input:
6 1 6 3 2 5 4
output:
11 7 7 7 6 8
result:
ok single line: '11 7 7 7 6 8 '
Test #2:
score: 0
Accepted
time: 0ms
memory: 22920kb
input:
2 1 2
output:
1 1
result:
ok single line: '1 1 '
Test #3:
score: 0
Accepted
time: 0ms
memory: 24992kb
input:
36 9 29 1 3 14 31 24 21 10 18 22 16 8 7 15 12 17 19 25 28 27 34 11 6 32 4 20 13 2 35 23 26 33 36 30 5
output:
92 89 90 90 91 78 73 71 71 71 65 65 64 64 63 65 65 70 74 85 95 91 111 111 109 111 110 110 110 107 136 136 137 136 168 168
result:
ok single line: '92 89 90 90 91 78 73 71 71 71 ...10 107 136 136 137 136 168 168 '
Test #4:
score: 0
Accepted
time: 0ms
memory: 23756kb
input:
63 30 17 34 8 29 57 2 62 35 27 24 22 54 53 60 37 31 19 1 5 20 14 3 36 38 40 56 39 50 32 51 9 15 52 55 45 63 41 6 47 23 7 33 10 26 61 16 58 43 42 44 48 28 12 49 11 59 4 21 25 46 13 18
output:
204 204 202 204 204 204 209 191 197 196 195 195 194 198 179 176 172 170 170 170 170 172 172 172 179 188 186 187 186 187 185 187 187 188 191 193 167 202 202 198 199 199 197 199 199 183 190 183 183 183 183 184 185 185 184 187 181 190 190 191 190 191 191
result:
ok single line: '204 204 202 204 204 204 209 19...87 181 190 190 191 190 191 191 '
Test #5:
score: 0
Accepted
time: 0ms
memory: 24668kb
input:
110 70 59 102 66 81 43 31 26 52 23 88 49 9 7 76 108 25 101 89 73 4 22 77 94 64 24 16 58 47 30 28 45 68 15 84 36 21 78 56 46 32 62 65 55 61 20 74 2 83 33 105 110 50 60 85 42 96 98 6 10 41 51 97 8 72 86 69 93 82 67 100 57 75 1 106 11 40 35 17 39 18 14 34 53 92 12 54 3 95 103 99 80 5 27 37 29 63 13 90 ...
output:
386 386 377 379 375 375 374 374 373 376 372 377 376 376 376 344 359 344 341 339 339 339 340 323 325 324 324 322 321 320 320 320 321 329 315 322 322 313 314 313 313 313 314 317 316 317 316 320 319 331 331 306 357 357 357 358 358 352 354 354 355 356 352 353 353 353 354 353 354 354 352 365 364 365 350 ...
result:
ok single line: '386 386 377 379 375 375 374 37...87 387 386 386 385 389 388 407 '
Test #6:
score: 0
Accepted
time: 0ms
memory: 25448kb
input:
192 186 25 95 115 187 44 154 54 80 121 89 117 68 74 27 137 171 112 22 60 6 109 97 14 101 166 82 126 15 69 92 51 174 162 65 156 132 150 56 138 20 93 85 103 164 26 77 124 170 34 185 188 116 98 120 123 148 16 100 49 53 88 179 102 94 169 96 37 140 48 146 40 125 141 45 129 11 19 175 43 144 184 5 10 7 2 8...
output:
693 693 693 694 649 653 644 645 645 643 644 642 643 642 643 643 639 644 644 643 644 641 642 642 642 640 648 645 646 646 646 647 631 649 649 646 647 643 644 640 641 640 641 641 640 651 651 652 652 665 665 658 708 708 708 710 708 709 706 707 707 708 692 697 697 690 691 691 690 692 688 691 691 689 690 ...
result:
ok single line: '693 693 693 694 649 653 644 64...34 840 839 838 836 836 836 837 '
Test #7:
score: 0
Accepted
time: 0ms
memory: 24084kb
input:
336 3 269 28 151 303 89 230 218 88 70 150 254 173 87 75 247 293 310 32 250 45 276 233 257 315 126 128 104 181 14 11 152 268 258 334 299 109 122 278 226 251 277 98 21 36 67 39 163 259 188 241 326 170 147 153 48 201 246 238 145 162 49 91 192 13 191 59 236 165 167 202 34 210 312 220 194 234 330 282 183...
output:
1475 1473 1474 1474 1463 1467 1465 1463 1462 1462 1462 1460 1464 1463 1463 1463 1466 1470 1487 1486 1487 1485 1487 1487 1480 1504 1503 1504 1501 1502 1502 1502 1503 1508 1367 1396 1396 1396 1388 1389 1389 1382 1380 1380 1380 1380 1381 1381 1384 1387 1387 1365 1379 1379 1378 1379 1379 1376 1367 1367 ...
result:
ok single line: '1475 1473 1474 1474 1463 1467 ... 1426 1449 1449 1448 1486 1486 '
Test #8:
score: 0
Accepted
time: 0ms
memory: 25588kb
input:
588 114 95 54 22 424 384 47 439 9 60 331 317 361 454 86 123 79 417 96 240 208 310 26 113 339 498 291 141 425 169 492 177 191 567 260 279 514 63 27 421 229 482 36 183 326 118 35 426 456 367 55 245 222 287 362 167 533 84 46 313 365 571 464 221 281 503 180 163 522 289 404 548 110 350 159 147 57 323 211...
output:
2271 2270 2269 2269 2268 2271 2271 2266 2273 2273 2273 2274 2274 2267 2280 2279 2280 2273 2275 2274 2275 2273 2275 2275 2276 2274 2298 2298 2297 2299 2297 2300 2300 2275 2308 2308 2298 2298 2298 2297 2299 2292 2295 2295 2295 2295 2295 2295 2293 2291 2291 2290 2291 2291 2292 2294 2290 2309 2309 2309 ...
result:
ok single line: '2271 2270 2269 2269 2268 2271 ... 3252 3252 3252 3250 3252 3252 '
Test #9:
score: 0
Accepted
time: 0ms
memory: 26236kb
input:
1029 97 622 1025 939 297 294 590 710 36 75 492 654 729 722 933 672 194 471 647 456 917 561 356 683 1027 650 873 723 911 986 508 680 384 390 530 179 823 512 884 130 266 343 715 517 524 398 905 855 670 6 354 952 581 16 302 958 60 52 519 810 927 712 258 96 336 185 363 120 999 779 587 61 478 286 614 845...
output:
5001 5001 4992 4980 4979 4979 4979 4977 4979 4979 4980 4981 4981 4986 4979 4979 4979 4979 4979 4980 4977 4981 4981 4981 4835 4859 4858 4859 4859 4831 4833 4830 4831 4831 4831 4832 4831 4836 4831 4835 4835 4836 4835 4836 4835 4836 4835 4842 4840 4840 4840 4839 4846 4846 4846 4842 4849 4849 4849 4851 ...
result:
ok single line: '5001 5001 4992 4980 4979 4979 ... 5271 5271 5270 5270 5270 5270 '
Test #10:
score: 0
Accepted
time: 2ms
memory: 24448kb
input:
1800 766 1174 1086 920 844 1508 1276 441 919 16 1053 1661 1742 1363 1 773 755 1636 84 521 1595 86 1506 724 1375 698 271 800 1696 472 15 1458 542 1662 1343 53 168 917 931 1660 257 19 1084 1684 1597 617 1553 270 1691 1443 1540 410 952 594 963 664 1657 1232 1429 253 1473 905 304 678 515 993 1357 998 18...
output:
9797 9796 9796 9795 9795 9792 9793 9793 9792 9793 9793 9795 9723 9733 9733 9732 9733 9729 9733 9733 9731 9732 9729 9730 9727 9727 9727 9727 9705 9717 9717 9716 9718 9711 9710 9710 9710 9711 9712 9710 9714 9714 9714 9714 9723 9723 9722 9723 9713 9723 9719 9720 9719 9720 9719 9721 9707 9713 9712 9713 ...
result:
ok single line: '9797 9796 9796 9795 9795 9792 ... 9476 9480 9477 9480 9479 9479 '
Test #11:
score: 0
Accepted
time: 0ms
memory: 24004kb
input:
3150 2016 1004 1533 2983 2188 426 737 2057 889 194 2681 613 2955 2104 333 689 2999 1485 1701 1761 29 2888 2328 2642 1585 2730 971 2355 1359 1350 2083 2347 434 2534 1629 2931 1776 969 1323 136 1721 1627 1425 277 3068 1390 614 2370 834 1407 2849 1751 928 292 1637 231 1636 2809 2433 462 1509 191 848 30...
output:
16472 16472 16472 16464 16464 16464 16464 16464 16464 16464 16463 16469 16467 16470 16470 16470 16452 16468 16468 16468 16469 16460 16462 16461 16462 16454 16456 16452 16452 16452 16452 16453 16455 16454 16460 16457 16468 16468 16467 16468 16467 16468 16467 16467 16459 16502 16502 16500 16502 16502 ...
result:
ok single line: '16472 16472 16472 16464 16464 ... 18151 18151 18152 18152 18185 '
Test #12:
score: 0
Accepted
time: 3ms
memory: 25092kb
input:
5512 5122 249 4482 37 1130 342 4012 2911 3534 5000 4910 5329 1780 4651 2673 2255 2130 66 1916 1854 3186 633 4080 2088 4802 3713 3806 2500 2800 4847 1789 5071 3476 2972 2785 3228 95 3989 178 4714 3450 4936 5212 2442 5276 1168 2688 2515 3009 4173 3218 3292 2090 2854 129 391 4120 609 4027 2703 680 1141...
output:
34679 34679 34674 34675 34674 34675 34673 34675 34675 34675 34682 34626 34637 34628 34628 34626 34624 34624 34623 34624 34623 34629 34628 34635 34632 34643 34641 34642 34642 34642 34650 34640 34642 34641 34641 34640 34642 34641 34646 34645 34650 34650 34652 34664 34634 34638 34637 34638 34638 34632 ...
result:
ok single line: '34679 34679 34674 34675 34674 ... 34878 34894 34893 34894 34894 '
Test #13:
score: 0
Accepted
time: 0ms
memory: 22852kb
input:
2 2 1
output:
1 1
result:
ok single line: '1 1 '
Test #14:
score: 0
Accepted
time: 6ms
memory: 27104kb
input:
9646 4083 1911 8250 7773 2595 5073 8165 8693 4036 236 4365 2065 7669 2442 3631 5796 5741 9047 1922 5503 7747 2031 4187 7895 3089 9381 3282 5635 7378 8720 7254 1678 3462 786 4569 7287 3388 5315 4446 9006 3062 3630 1182 7230 8481 7938 8114 1581 3290 4126 5330 2311 7929 227 1457 9607 7240 23 7008 8837 ...
output:
56216 56216 56212 56212 56212 56212 56213 56209 56215 56215 56214 56216 56213 56216 56216 56216 56217 56211 56228 56228 56227 56228 56228 56228 56231 56213 56238 56238 56239 56233 56230 56230 56229 56230 56230 56230 56235 56234 56235 56229 56239 56238 56239 56239 56235 56237 56230 56231 56231 56232 ...
result:
ok single line: '56216 56216 56212 56212 56212 ... 76814 76840 76840 76839 76841 '
Test #15:
score: 0
Accepted
time: 5ms
memory: 27240kb
input:
16880 2620 5517 15317 14624 3162 3872 16556 1032 12526 8373 5617 9938 2396 9520 5386 10125 14441 8334 3564 1734 14365 9674 4994 1584 8939 3039 9744 11195 1039 10794 14520 5616 7740 14885 2305 5122 2334 144 7635 14842 16058 225 8844 11893 10115 12681 7593 15281 10705 1275 11916 5855 10548 16245 3159 ...
output:
126395 126395 126394 126394 126394 126394 126346 126352 126345 126345 126345 126343 126345 126344 126345 126345 126340 126347 126346 126346 126338 126338 126337 126337 126336 126338 126338 126341 126345 126345 126344 126361 126361 126356 126371 126370 126370 126370 126370 126373 126368 126376 126376...
result:
ok single line: '126395 126395 126394 126394 12...78 109082 109095 109094 109095 '
Test #16:
score: 0
Accepted
time: 19ms
memory: 31204kb
input:
29540 21660 2028 12964 6138 24030 20445 10053 17204 20432 863 17996 13607 10819 11136 15689 9902 14559 17935 13982 16518 26375 3516 18377 15190 11520 18426 14397 21421 27432 13490 24097 2332 5574 1451 24688 28254 18558 25985 26192 29067 10134 15556 10078 11734 29033 18604 19513 12836 5044 24817 2381...
output:
225212 225212 225211 225212 225209 225209 225209 225209 225203 225204 225196 225195 225195 225195 225194 225197 225197 225196 225200 225200 225194 225214 225213 225213 225213 225212 225215 225215 225213 225241 225239 225240 225239 225240 225240 225241 225276 225276 225277 225271 225310 225308 225309...
result:
ok single line: '225212 225212 225211 225212 22...47 221047 221048 221048 221050 '
Test #17:
score: 0
Accepted
time: 31ms
memory: 33488kb
input:
51695 25757 46390 46936 35417 38407 50322 34131 45113 48067 40556 43162 38421 18517 22542 34293 39180 16755 38132 44939 5760 21027 4643 41258 22179 40253 14694 6659 18296 47470 19801 7302 45675 31360 9788 33220 33106 26159 28585 35811 13400 37315 18401 23221 22583 7530 47246 38366 49277 25080 50788 ...
output:
391066 391066 391065 391067 391067 391026 391031 391031 391002 391003 390997 390995 390995 390995 390996 390995 390999 390999 390995 391003 391002 391003 391000 391002 390999 390999 390999 390999 390984 390997 390997 390987 390988 390988 390986 390986 390986 390986 390986 390991 390989 390994 390993...
result:
ok single line: '391066 391066 391065 391067 39...84 498084 498083 498085 498085 '
Test #18:
score: 0
Accepted
time: 55ms
memory: 43676kb
input:
90466 29089 23465 25716 3629 50971 22470 48859 55467 72802 49276 70808 9377 69724 57726 69918 26033 4604 66193 155 79747 19849 11388 29639 38214 81901 33586 81767 22269 67108 89312 72587 12737 81405 36261 54036 73876 61084 5386 22093 90119 79588 64897 89069 64078 7067 80737 39378 39754 62061 17827 7...
output:
807940 807940 807939 807940 807938 807942 807942 807943 807946 807954 807949 807950 807949 807950 807947 807948 807948 807947 807949 807945 807963 807963 807963 807965 807964 807988 807986 807987 807987 807983 808011 808011 808008 808010 808010 808009 808008 808008 808008 807132 807170 807170 807094...
result:
ok single line: '807940 807940 807939 807940 80...89 689088 689090 689089 689092 '
Test #19:
score: 0
Accepted
time: 98ms
memory: 56456kb
input:
158315 62178 4434 123737 96786 81926 3922 34992 97731 98678 147622 91816 40832 48627 43111 90353 147554 16042 123199 84597 32319 94149 110323 30035 147659 145023 23971 17026 6722 23884 118418 92184 83560 150010 152570 45000 10337 53681 15818 105963 68507 62496 49670 48658 115914 86541 31751 49111 13...
output:
1277042 1277042 1277036 1277036 1277034 1277034 1277034 1277035 1277039 1277036 1277041 1277041 1277040 1277041 1277041 1277038 1277043 1277039 1277039 1277039 1277039 1277040 1277042 1277039 1277057 1277054 1277053 1277053 1277053 1277054 1277057 1277057 1277057 1277064 1277096 1277096 1277095 1277...
result:
ok single line: '1277042 1277042 1277036 127703...324395 1324393 1324395 1324395 '
Test #20:
score: 0
Accepted
time: 179ms
memory: 83976kb
input:
277051 132642 165514 158003 120016 153522 201662 226711 268617 145665 30979 192592 61026 240472 67380 68422 221783 201493 127374 264150 144250 18261 238987 40974 134787 244832 276228 98112 50224 206799 16649 247375 107624 213918 187954 34950 36807 255977 143136 97230 259959 247959 183983 78607 19162...
output:
2629197 2629195 2629194 2629194 2629194 2629195 2629200 2629191 2629197 2629197 2629196 2629198 2629195 2629198 2629198 2629198 2629198 2629198 2629192 2629198 2629198 2629196 2629198 2629198 2629199 2628422 2628446 2628446 2628445 2628447 2628445 2628448 2628446 2628445 2628445 2628445 2628445 2628...
result:
ok single line: '2629197 2629195 2629194 262919...279650 2279650 2279651 2279651 '
Test #21:
score: 0
Accepted
time: 178ms
memory: 77684kb
input:
262142 170465 225058 248463 155214 235457 208686 37676 172736 204107 181502 161769 171326 90738 123185 45301 109851 85505 229991 70616 250517 248629 171505 11331 90670 135216 250761 236384 141122 138348 108406 192420 74275 215952 113433 146716 115791 160655 178073 138620 184624 257945 206781 207559 ...
output:
2276751 2276751 2276747 2276749 2276736 2276734 2276734 2276734 2276733 2276731 2276731 2276728 2276729 2276727 2276728 2276727 2276728 2276727 2276739 2276738 2276754 2276751 2276751 2276751 2276752 2276748 2276762 2276761 2276760 2276760 2276759 2276762 2276755 2276759 2276758 2276759 2276759 2276...
result:
ok single line: '2276751 2276751 2276747 227674...369712 2369714 2369715 2369716 '
Test #22:
score: 0
Accepted
time: 184ms
memory: 77304kb
input:
262143 104690 24534 218732 138014 100511 185497 214245 5776 216429 169892 27467 176352 2259 215862 201935 4122 199348 66381 221330 249611 95524 167976 248902 109967 101818 202850 31715 139528 26578 224649 223222 235766 4443 156237 229678 41057 140361 110 111176 55338 177637 234749 64915 60304 104561...
output:
2198605 2198605 2198596 2198597 2198597 2198597 2198598 2198600 2198595 2198596 2198596 2198595 2198597 2198595 2198596 2198596 2198595 2198596 2198596 2198604 2198623 2198623 2198609 2198609 2198609 2198607 2198609 2198608 2198609 2198608 2198613 2198602 2198606 2198606 2198601 2198602 2198600 2198...
result:
ok single line: '2198605 2198605 2198596 219859...418295 2418295 2418296 2418302 '
Test #23:
score: 0
Accepted
time: 178ms
memory: 77708kb
input:
262144 214478 58333 173353 144219 144132 109974 63097 90872 34077 11764 139960 110695 198098 247191 49838 91097 195596 234166 23774 82368 198358 71750 201949 160648 129902 84496 86828 87893 84925 104692 63510 149545 31853 213266 97983 261204 134167 1134 182062 191913 46997 208182 136097 261055 13809...
output:
2138945 2138945 2138944 2138942 2138936 2138934 2138934 2138933 2138933 2138933 2138932 2138937 2138937 2138938 2138951 2138951 2138952 2138937 2138938 2138938 2138938 2138939 2138934 2138928 2138923 2138923 2138923 2138923 2138924 2138923 2138925 2138924 2138931 2138930 2138942 2138921 2138955 2138...
result:
ok single line: '2138945 2138945 2138944 213894...189651 2189655 2189654 2189655 '
Test #24:
score: 0
Accepted
time: 0ms
memory: 24952kb
input:
3 1 2 3
output:
2 2 3
result:
ok single line: '2 2 3 '
Test #25:
score: 0
Accepted
time: 161ms
memory: 77484kb
input:
262145 137633 85042 78668 86888 164296 78818 99660 17023 138296 91902 105221 155594 20867 233386 178776 125453 34246 199388 14125 39335 69217 114560 123725 239648 170713 115499 199125 78683 131215 202159 157626 142536 231410 217134 236637 205948 241634 136331 200931 6891 156420 142217 131866 7713 52...
output:
2305742 2305741 2305741 2305741 2305736 2305740 2305739 2305740 2305738 2305740 2305740 2305740 2305744 2305736 2305748 2305747 2305747 2305742 2305745 2305745 2305746 2305747 2305748 2305738 2305760 2305760 2305758 2305760 2305760 2305760 2305763 2305763 2305762 2305766 2305765 2305769 2305758 2305...
result:
ok single line: '2305742 2305741 2305741 230574...379701 2379701 2379702 2379705 '
Test #26:
score: 0
Accepted
time: 172ms
memory: 81900kb
input:
262146 95481 247989 115902 154711 248737 186448 219360 126937 88912 176372 2585 128596 246976 112951 24632 206233 86616 13659 143536 66605 34933 52511 23503 199359 2880 57690 106624 8847 134687 215953 157186 116177 103855 152864 28824 132268 217119 83956 259046 113758 65655 93493 205000 176629 19493...
output:
2121755 2121753 2121754 2121754 2121730 2121734 2121730 2121730 2121730 2121728 2121730 2121730 2121707 2121712 2121712 2121701 2121702 2121702 2121700 2121700 2121700 2121699 2121700 2121695 2121701 2121701 2121701 2121702 2121702 2121702 2121713 2121712 2121712 2121710 2121712 2121712 2121712 2121...
result:
ok single line: '2121755 2121753 2121754 212175...411207 2411207 2411206 2411211 '
Test #27:
score: 0
Accepted
time: 222ms
memory: 83780kb
input:
299997 110211 290304 52567 198511 245392 79155 82217 279881 18934 203294 18871 20938 137230 160056 84518 55725 296273 94773 50586 275945 171481 249827 252924 163275 206989 58868 199567 71622 243840 190814 174920 106404 295338 277115 69484 270150 173661 120412 168097 12268 297280 200375 274813 49868 ...
output:
2752164 2752157 2752158 2752158 2752157 2752158 2752158 2752154 2752157 2752153 2752154 2752154 2752155 2752155 2752155 2752155 2752139 2752154 2752154 2752148 2752150 2752150 2752145 2752146 2752144 2752145 2752144 2752145 2752144 2752147 2752146 2752146 2752144 2752156 2752156 2752154 2752153 2752...
result:
ok single line: '2752164 2752157 2752158 275215...575943 2575943 2575944 2575948 '
Test #28:
score: 0
Accepted
time: 203ms
memory: 84552kb
input:
299998 240166 183171 165015 193616 65824 209177 42607 88749 4592 296562 272668 179523 255687 30360 269077 76531 167248 9030 281782 134643 201939 129347 40381 173669 80180 142144 37965 276710 122758 262376 132933 190340 161526 100139 109633 62702 34801 295282 34467 160410 162383 183881 58257 98179 70...
output:
2685242 2685241 2685241 2685240 2685242 2685240 2685243 2685242 2685243 2685202 2685206 2685206 2685205 2685206 2685204 2685206 2685205 2685206 2685196 2685204 2685200 2685200 2685200 2685198 2685200 2685199 2685200 2685197 2685204 2685202 2685203 2685201 2685200 2685200 2685199 2685199 2685199 2685...
result:
ok single line: '2685242 2685241 2685241 268524...777189 2777187 2777235 2777235 '
Test #29:
score: 0
Accepted
time: 202ms
memory: 84716kb
input:
299999 105930 212862 21071 157050 113702 184087 124574 231608 38277 25763 10690 19888 214129 181674 171613 45263 141098 231952 172852 251745 261985 141691 227700 53264 96105 48865 268621 155281 161558 288366 61371 280278 130126 273509 111673 245641 50661 130042 9204 266706 245914 238704 10493 1506 1...
output:
2499235 2499231 2499232 2499231 2499232 2499231 2499233 2499228 2499233 2499231 2499231 2499231 2499231 2499233 2499231 2499231 2499231 2499231 2499248 2499248 2499264 2499284 2499282 2499283 2499282 2499283 2499281 2499307 2499307 2499301 2499330 2499316 2499317 2499311 2499312 2499310 2499311 2499...
result:
ok single line: '2499235 2499231 2499232 249923...822032 2822032 2822032 2822032 '
Test #30:
score: 0
Accepted
time: 217ms
memory: 84552kb
input:
300000 163822 58989 16780 215522 20501 12024 236573 262652 178873 123608 194105 120608 172509 183878 42132 146797 116759 156880 20102 144103 213635 195920 182228 53103 146480 238295 262599 48890 211538 298143 271113 182177 37283 184583 218820 73054 179455 196972 111684 112927 64407 230534 17226 1417...
output:
2600523 2600522 2600522 2600521 2600523 2600523 2600523 2600509 2600515 2600515 2600510 2600512 2600512 2600508 2600509 2600508 2600509 2600507 2600509 2600509 2600509 2600518 2600516 2600516 2600516 2600517 2600527 2600532 2600532 2600498 2600513 2600512 2600512 2600512 2600510 2600512 2600512 2600...
result:
ok single line: '2600523 2600522 2600522 260052...632471 2632471 2632471 2632502 '
Test #31:
score: 0
Accepted
time: 178ms
memory: 118276kb
input:
300000 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:
299999 299999 300000 300002 300005 300009 300014 300020 300027 300035 300044 300054 300065 300077 300090 300104 300119 300135 300152 300170 300189 300209 300230 300252 300275 300299 300324 300350 300377 300405 300434 300464 300495 300527 300560 300594 300629 300665 300702 300740 300779 300819 300860...
result:
ok single line: '299999 299999 300000 300002 30...250005 44999550002 44999850000 '
Test #32:
score: 0
Accepted
time: 162ms
memory: 118472kb
input:
300000 300000 299999 299998 299997 299996 299995 299994 299993 299992 299991 299990 299989 299988 299987 299986 299985 299984 299983 299982 299981 299980 299979 299978 299977 299976 299975 299974 299973 299972 299971 299970 299969 299968 299967 299966 299965 299964 299963 299962 299961 299960 299959...
output:
44999850000 44999550002 44999250005 44998950009 44998650014 44998350020 44998050027 44997750035 44997450044 44997150054 44996850065 44996550077 44996250090 44995950104 44995650119 44995350135 44995050152 44994750170 44994450189 44994150209 44993850230 44993550252 44993250275 44992950299 44992650324 ...
result:
ok single line: '44999850000 44999550002 449992...05 300002 300000 299999 299999 '
Test #33:
score: 0
Accepted
time: 222ms
memory: 93944kb
input:
300000 300000 299997 299993 299991 299990 299989 299988 299986 299985 299983 299982 299977 299975 299974 299973 299971 299969 299967 299966 299965 299964 299962 299961 299960 299956 299955 299954 299950 299949 299945 299944 299940 299931 299928 299927 299925 299919 299917 299915 299913 299912 299910...
output:
14984302490 14984002494 14983702502 14983702501 14983702500 14983702498 14983402511 14983402509 14983102525 14982802544 14982502563 14982202587 14982202586 14982202582 14981902610 14981602640 14981302672 14981302671 14981302670 14981302668 14981002705 14981002704 14980702745 14980402786 14980402785 ...
result:
ok single line: '14984302490 14984002494 149837...302488 14984302489 14984602486 '
Test #34:
score: 0
Accepted
time: 232ms
memory: 91244kb
input:
300000 299999 300000 299993 299997 299992 299990 299985 299987 299980 299979 299981 299977 299973 299972 299978 299971 299966 299970 299965 299964 299963 299960 299959 299957 299954 299958 299951 299948 299947 299942 299943 299941 299936 299938 299934 299935 299932 299928 299926 299933 299924 299922...
output:
9666039405 9665739407 9665739408 9665439414 9665139427 9664839439 9664839439 9664539455 9664539455 9664539455 9664239480 9664239481 9664239480 9664239480 9663939508 9663639544 9663639544 9663339577 9663339577 9663339575 9663039614 9663039612 9662739656 9662739655 9662739655 9662439700 9662139753 966...
result:
ok single line: '9666039405 9665739407 96657394...65739406 9665739407 9665739407 '
Test #35:
score: 0
Accepted
time: 3ms
memory: 25396kb
input:
3 1 3 2
output:
3 2 3
result:
ok single line: '3 2 3 '
Test #36:
score: 0
Accepted
time: 239ms
memory: 88800kb
input:
300000 299998 299992 299999 299979 299977 299993 299971 299988 299969 299967 299978 299960 299976 299959 299955 299956 299950 299952 299945 299942 299940 299970 299941 299936 299937 299954 299933 299929 299931 299922 299918 299919 299912 299913 299927 299905 299909 299903 299911 299902 299900 299898...
output:
5990842884 5990842884 5990542889 5990542890 5990542890 5990242904 5990242906 5989942924 5989942924 5989942924 5989642956 5989642958 5989342991 5989342989 5989342989 5989342987 5989342988 5989342987 5989342987 5989342986 5989342986 5989043031 5989043037 5989043037 5989043037 5988743095 5988443173 598...
result:
ok single line: '5990842884 5990842884 59905428...90842883 5990842884 5991142882 '
Test #37:
score: 0
Accepted
time: 222ms
memory: 85864kb
input:
300000 299999 299992 299989 300000 299984 299993 299997 299994 299983 299978 299972 299986 299991 299964 299967 299998 299962 299987 299970 299981 299954 299947 299958 299977 299960 299980 299946 299940 299927 299931 299944 299934 299961 299920 299921 299943 299913 299915 299929 299914 299902 299912...
output:
3514146902 3514146901 3514146901 3513846905 3513846908 3513846908 3513846904 3513846899 3513846898 3513846897 3513846897 3513846897 3513846898 3513846901 3513846901 3513546918 3513546927 3513546921 3513546922 3513246954 3513246954 3513246954 3513246954 3513246955 3513246957 3512946993 3512946991 351...
result:
ok single line: '3514146902 3514146901 35141469...13846899 3513846899 3513846900 '
Test #38:
score: 0
Accepted
time: 242ms
memory: 85740kb
input:
300000 299982 299994 299987 299985 299983 299998 299977 299974 299979 299996 299995 299959 299978 299964 299957 299968 299958 299971 299976 299991 299962 299972 300000 299992 299949 299934 299953 299928 299932 299951 299921 299967 299924 299950 299916 299984 299938 299914 299930 299954 299933 299906...
output:
1858051072 1858051071 1858051071 1858051070 1858051070 1858051066 1858051070 1858051070 1858051070 1858051064 1858051056 1858051056 1858051050 1858051050 1858051050 1858051049 1858051051 1858051051 1858051054 1858051054 1858051061 1858051061 1857751085 1857451149 1857451148 1857451148 1857451145 185...
result:
ok single line: '1858051072 1858051071 18580510...58051060 1858051060 1858051061 '
Test #39:
score: 0
Accepted
time: 219ms
memory: 83476kb
input:
300000 299993 299947 299968 299959 299981 299985 299944 299941 299955 299973 299953 299939 299935 299975 299986 299925 299931 299991 299929 299976 299934 299919 299943 299950 299972 299940 299954 299964 299956 299930 299937 299923 299963 299924 299913 299984 299951 299914 299907 299917 299902 299928...
output:
1215936484 1215936484 1215936483 1215936484 1215936484 1215936478 1215936479 1215936479 1215936479 1215936480 1215936481 1215936480 1215936480 1215936480 1215936482 1215936491 1215936491 1215936470 1215936477 1215936470 1215936470 1215936470 1215936470 1215936472 1215936469 1215936470 1215936470 121...
result:
ok single line: '1215936484 1215936484 12159364...16236571 1216236571 1216236571 '
Test #40:
score: 0
Accepted
time: 171ms
memory: 102912kb
input:
300000 1 3 5 8 9 10 12 14 17 19 20 21 23 24 26 27 38 40 41 42 43 45 46 47 48 49 51 53 57 58 60 61 63 68 69 71 73 75 76 77 78 79 81 83 87 88 92 95 96 97 98 99 100 102 105 106 108 109 111 112 113 114 116 121 123 124 125 126 128 129 134 135 136 137 138 139 146 149 151 153 154 155 160 161 162 166 168 16...
output:
11223241289 11223241289 11223241290 11223241292 11223241295 11223241299 11223241304 11223241310 11223241317 11223241325 11223241334 11223241344 11223241355 11223241367 11223241380 11223241394 11223241409 11223241425 11223241442 11223241460 11223241479 11223241499 11223241520 11223241542 11223241565 ...
result:
ok single line: '11223241289 11223241289 112232...391290 11277391289 11277391289 '
Test #41:
score: 0
Accepted
time: 184ms
memory: 95720kb
input:
300000 8 5 9 15 13 18 22 23 16 24 25 30 27 42 43 37 45 46 52 53 50 58 55 61 67 65 71 72 73 68 75 84 85 78 87 91 89 93 95 96 94 98 99 97 101 100 109 110 112 103 117 118 121 120 122 124 129 130 125 132 136 140 142 133 144 143 147 150 151 145 154 153 157 162 160 166 167 170 179 180 181 164 182 195 197 ...
output:
6263623047 6263623047 6263623047 6263623048 6263623051 6263623051 6263623056 6263623061 6263623068 6263623068 6263623077 6263623086 6263623097 6263623097 6263623109 6263623123 6263623123 6263623139 6263623156 6263623173 6263623192 6263623191 6263623212 6263623212 6263623234 6263623258 6263623258 626...
result:
ok single line: '6263623047 6263623047 62636230...05810525 8305810524 8305810525 '
Test #42:
score: 0
Accepted
time: 186ms
memory: 92652kb
input:
300000 2 1 5 7 11 6 10 16 8 22 21 26 30 27 25 33 36 23 48 43 38 46 56 58 64 65 49 68 70 67 72 74 79 73 75 82 84 66 83 86 93 92 90 89 99 101 98 106 104 94 100 114 115 113 119 116 122 127 130 133 135 128 132 131 136 149 140 153 148 157 158 156 166 141 165 161 169 177 170 168 173 179 180 184 190 181 19...
output:
3543491933 3543491933 3543491933 3543491935 3543491936 3543491940 3543491940 3543491940 3543491947 3543491946 3543491955 3543491955 3543491965 3543491976 3543491976 3543491976 3543491990 3543492006 3543492003 3543492020 3543492020 3543492020 3543492022 3543492044 3543492067 3543492090 3543492115 354...
result:
ok single line: '3543491933 3543491933 35434919...78797191 6178797192 6178797192 '
Test #43:
score: 0
Accepted
time: 213ms
memory: 88416kb
input:
300000 11 8 9 1 10 7 13 6 19 14 20 31 24 22 30 26 33 29 40 2 32 42 36 44 52 37 46 64 48 66 74 60 67 53 34 77 63 75 72 98 85 82 109 103 116 87 80 113 97 106 119 88 130 134 100 126 124 139 131 143 147 145 146 148 150 123 142 154 135 158 151 157 161 163 133 162 153 149 159 170 132 173 168 167 164 189 1...
output:
1914177530 1914177530 1914177529 1914177530 1914177529 1914177531 1914177530 1914177536 1914177535 1914177543 1914177543 1914177550 1914177560 1914177560 1914177559 1914177561 1914177560 1914177576 1914177574 1914177592 1914177592 1914177592 1914177613 1914177613 1914177634 1914177658 1914177658 191...
result:
ok single line: '1914177530 1914177530 19141775...04551764 4304551764 4304551764 '
Test #44:
score: 0
Accepted
time: 191ms
memory: 88420kb
input:
300000 13 9 1 4 6 42 20 32 46 31 14 37 44 22 36 51 49 38 19 50 43 67 29 54 60 61 17 71 45 85 53 23 80 3 75 88 103 91 58 84 89 108 109 62 76 56 120 72 121 59 97 106 110 102 134 130 139 141 100 147 148 115 113 116 137 159 119 152 99 157 155 78 163 164 149 133 158 126 154 181 114 173 167 188 179 178 18...
output:
1007759891 1007759888 1007759888 1007759888 1007759889 1007759888 1007759893 1007759893 1007759889 1007759896 1007759896 1007759896 1007759896 1007759898 1007759898 1007759895 1007759909 1007759908 1007759908 1007759907 1007759910 1007759906 1007759927 1007759927 1007759928 1007759928 1007759929 100...
result:
ok single line: '1007759891 1007759888 10077598...06963744 2906963744 2906963747 '
Test #45:
score: 0
Accepted
time: 207ms
memory: 87612kb
input:
300000 48 24 57 34 61 23 67 45 29 12 25 50 5 69 72 53 74 55 39 58 82 66 64 27 100 44 52 102 9 90 70 104 101 60 119 26 36 99 123 68 107 136 75 86 97 115 111 137 140 117 59 13 79 135 83 164 156 168 33 120 93 7 91 187 125 172 149 183 132 88 167 124 189 109 195 206 182 212 80 194 110 155 139 216 180 85 ...
output:
635598678 635598678 635598677 635598679 635598678 635598682 635598677 635598681 635598679 635598679 635598679 635598679 635598683 635598683 635598695 635598709 635598706 635598721 635598721 635598721 635598722 635598741 635598740 635598740 635598738 635598762 635598762 635598761 635598788 635598787 ...
result:
ok single line: '635598678 635598678 635598677 ...65892579 2265892579 2265892583 '
Test #46:
score: 0
Accepted
time: 0ms
memory: 24156kb
input:
3 3 2 1
output:
3 2 2
result:
ok single line: '3 2 2 '
Test #47:
score: 0
Accepted
time: 228ms
memory: 85264kb
input:
299999 299998 299997 299995 299993 299994 299991 299992 299996 299999 3 2 1 7 4 5 6 299990 299988 299986 299987 299985 299989 299977 299976 299975 299978 299982 299979 299980 299981 299983 22 23 17 21 18 19 20 25 24 299972 26 31 29 27 28 30 299965 299963 299961 299960 299962 299964 39 40 44 42 41 43...
output:
2733859582 2733859576 2733859573 2733859573 2733859571 2733859572 2733859572 2733859573 2733559588 2733559595 2733559594 2733559594 2733559591 2733559594 2733559594 2733559595 2733259614 2733259618 2733259618 2733259617 2733259618 2732959641 2732959644 2732959643 2732959643 2732959643 2732959643 273...
result:
ok single line: '2733859582 2733859576 27338595...33259595 2733259594 2733259594 '
Test #48:
score: 0
Accepted
time: 218ms
memory: 83196kb
input:
300000 299999 299996 299994 299995 299997 299992 299993 299998 299991 300000 299983 299980 299976 299977 299978 299979 299982 299981 299984 299952 299947 299948 299949 17 18 13 14 15 16 19 299946 299936 299937 299938 299930 299929 299934 299933 299931 299932 299935 33 34 29 31 30 32 28 299928 35 299...
output:
2725220086 2725220084 2725220084 2725220084 2725220083 2725220086 2725220086 2725220086 2725220090 2724920100 2724920103 2724920099 2724920099 2724920099 2724920100 2724920101 2724920101 2724920106 2724620139 2724320209 2724320209 2724320209 2724020287 2724020288 2724020284 2724020285 2724020285 272...
result:
ok single line: '2725220086 2725220084 27252200...25220085 2725220085 2725220086 '
Test #49:
score: 0
Accepted
time: 223ms
memory: 85360kb
input:
300000 6 3 4 2 1 5 300000 7 14 8 10 9 13 12 11 299999 25 24 26 23 27 22 299993 30 31 29 28 299992 299986 299989 299988 299987 299990 299991 36 37 35 33 34 32 299985 299969 299977 299972 299971 299975 299973 299974 299976 299970 299978 299961 299962 299963 54 55 56 52 53 57 49 51 50 299959 61 59 58 6...
output:
2711664821 2711664821 2711664820 2711664820 2711664820 2711664820 2711364830 2711364836 2711364832 2711364833 2711364832 2711364833 2711364832 2711364833 2711364833 2711064849 2711064855 2711064855 2711064854 2711064856 2711064855 2711064858 2711064848 2711064851 2711064850 2711064850 2711064850 271...
result:
ok single line: '2711664821 2711664821 27116648...11364834 2711364833 2711364836 '
Test #50:
score: 0
Accepted
time: 207ms
memory: 85696kb
input:
299999 299974 299973 299976 299975 299989 299986 299987 299981 299980 299979 299983 299982 299985 299984 299988 299977 299978 299990 299962 299963 299961 299968 299965 299964 299966 299967 299969 79 80 74 75 76 72 73 78 77 81 299949 82 88 86 87 83 85 84 97 89 90 95 91 92 93 94 96 299936 299928 29991...
output:
1428048597 1428048597 1428048596 1428048598 1428048587 1428048591 1428048585 1428048585 1428048584 1428048584 1428048583 1428048586 1428048585 1428048589 1428048587 1428048595 1428048595 1427748641 1427748658 1427748657 1427748658 1427748654 1427748655 1427748655 1427748655 1427748657 1427448740 142...
result:
ok single line: '1428048597 1428048597 14280485...28948528 1428948527 1428948528 '
Test #51:
score: 0
Accepted
time: 217ms
memory: 85636kb
input:
300000 299964 299959 299958 299960 299957 299961 299956 299963 299962 299965 299955 299966 14 299944 299940 299941 299942 299934 299939 299938 299935 299937 299936 299943 15 16 20 17 18 19 299933 299900 299901 299902 299895 299897 299896 299898 299899 299903 299913 299907 299904 299906 299905 299912...
output:
1430537598 1430537597 1430537597 1430537596 1430537598 1430537597 1430537600 1430537599 1430537602 1430537601 1430537610 1430237659 1430237670 1430237655 1430237656 1430237656 1430237655 1430237656 1430237654 1430237653 1430237653 1430237652 1430237653 1429937743 1429937750 1429937750 1429937748 142...
result:
ok single line: '1430537598 1430537597 14305375...31137537 1431137537 1431137537 '
Test #52:
score: 0
Accepted
time: 228ms
memory: 84544kb
input:
300000 299998 299999 299996 299997 299994 299995 300000 299980 299948 299947 299944 299943 299945 299946 299949 299941 299940 299942 51 50 49 48 52 54 53 299938 299933 299934 299935 299932 299936 299937 56 55 299907 69 71 70 299878 299875 299873 299874 299869 299871 299870 299872 299876 299877 29985...
output:
1431564930 1431564927 1431564928 1431564926 1431564927 1431564927 1431264935 1430965008 1430965004 1430965000 1430964999 1430964999 1430964999 1430965001 1430964987 1430964992 1430964992 1430665098 1430665099 1430665098 1430665097 1430665097 1430665097 1430665100 1430665104 1430365238 1430365240 143...
result:
ok single line: '1431564930 1431564927 14315649...31564874 1431564875 1431564875 '
Test #53:
score: 0
Accepted
time: 304ms
memory: 85112kb
input:
299998 21 19 20 22 24 23 25 31 29 30 26 28 27 45 43 37 36 42 40 41 39 38 44 34 35 32 33 299997 299948 299949 299944 299947 299945 299946 299950 299942 299943 299954 299953 299951 299952 299955 66 64 65 67 62 63 68 61 60 59 299941 104 109 105 106 107 108 122 112 111 113 114 110 121 116 117 115 120 11...
output:
586284653 586284653 586284653 586284654 586284656 586284660 586284660 586284663 586284670 586284668 586284669 586284668 586284669 586284659 586284668 586284667 586284667 586284665 586284667 586284666 586284666 586284666 586284663 586284671 586284669 586284670 586284670 585984734 585984761 585984758 ...
result:
ok single line: '586284653 586284653 586284653 ... 586584613 586584613 586584613 '
Test #54:
score: 0
Accepted
time: 211ms
memory: 84164kb
input:
300000 299997 299998 299996 299995 299999 299988 299993 299991 299989 299990 299992 299994 300000 299952 299953 299954 299950 299951 299955 299945 299949 299947 299946 299948 299986 299956 299962 299960 299958 299957 299959 299961 299980 299975 299976 299978 299977 299979 299964 299967 299965 299966...
output:
589459219 589459218 589459218 589459218 589459211 589459215 589459211 589459210 589459210 589459210 589459211 589459214 589159232 589159244 589159244 589159243 589159244 589159244 589159242 589159245 589159242 589159242 589159242 589159242 589159214 589159221 589159216 589159214 589159213 589159213 ...
result:
ok single line: '589459219 589459218 589459218 ... 588259478 588259479 588259480 '
Test #55:
score: 0
Accepted
time: 213ms
memory: 85116kb
input:
299996 299950 299931 299928 299930 299929 299936 299932 299935 299933 299934 299941 299937 299940 299939 299938 299946 299942 299945 299944 299943 299947 299927 41 40 43 42 53 51 50 48 49 52 45 44 47 46 54 39 85 79 76 77 75 78 80 81 60 59 58 64 62 61 63 65 56 55 57 74 67 68 66 73 72 70 71 69 84 83 8...
output:
584577863 584577861 584577861 584577860 584577861 584577858 584577862 584577860 584577861 584577861 584577860 584577867 584577866 584577866 584577866 584577864 584577872 584577871 584577871 584577871 584577837 584278022 584278021 584278021 584278020 584278022 584278016 584278017 584278015 584278015 ...
result:
ok single line: '584577863 584577861 584577861 ... 585477595 585477596 585477596 '
Test #56:
score: 0
Accepted
time: 217ms
memory: 83800kb
input:
300000 299992 299990 299991 299993 299995 299994 299996 299981 299984 299983 299982 299989 299986 299985 299988 299987 299998 299997 299999 299973 299972 299970 299971 299974 299969 299968 299975 299964 299965 299961 299962 299963 299960 299959 299967 299966 299976 299923 299922 299925 299924 299928...
output:
197104520 197104520 197104520 197104521 197104523 197104527 197104521 197104527 197104526 197104526 197104526 197104523 197104525 197104525 197104524 197104526 197104525 197104541 197104479 197104495 197104493 197104493 197104493 197104493 197104496 197104496 197104488 197104494 197104491 197104492 ...
result:
ok single line: '197104520 197104520 197104520 ... 197104372 197104373 197104373 '
Test #57:
score: 0
Accepted
time: 0ms
memory: 23700kb
input:
4 3 1 4 2
output:
4 4 3 5
result:
ok single line: '4 4 3 5 '
Test #58:
score: 0
Accepted
time: 203ms
memory: 84916kb
input:
299995 299991 299992 299990 299993 299981 299980 299982 299979 299983 299984 299977 299978 299985 299986 299976 299975 299974 299972 299973 299971 299989 299987 299988 299994 177 184 182 183 180 181 179 178 236 191 193 192 194 195 185 189 187 188 186 190 235 206 208 207 209 200 201 205 204 202 203 2...
output:
200074983 200074982 200074983 200074965 200074967 200074967 200074966 200074968 200074968 200074969 200074971 200074971 200074972 200074974 200074975 200074973 200074971 200074971 200074970 200074971 200074969 200074976 200074976 199775292 199775315 199775312 199775313 199775311 199775312 199775311 ...
result:
ok single line: '200074983 200074982 200074983 ... 200075039 200075039 200075039 '
Test #59:
score: 0
Accepted
time: 200ms
memory: 84864kb
input:
300000 299982 299983 299984 299969 299968 299967 299970 299971 299966 299975 299972 299973 299974 299978 299976 299977 299980 299979 299981 299951 299952 299953 299965 299954 299955 299964 299960 299961 299959 299962 299963 299958 299956 299957 299985 299948 299944 299943 299946 299945 299947 299949...
output:
195823552 195823552 195823534 195823535 195823534 195823534 195823534 195823536 195823539 195823536 195823538 195823538 195823539 195823538 195823543 195823543 195823543 195823547 195823541 195823544 195823544 195823545 195823539 195823540 195823540 195823536 195823537 195823536 195823537 195823537 ...
result:
ok single line: '195823552 195823552 195823534 ... 196422752 196422752 196422752 '
Test #60:
score: 0
Accepted
time: 216ms
memory: 82768kb
input:
300000 299312 299313 299309 299310 299311 299314 299307 299304 299303 299302 299306 299305 299308 299295 299296 299298 299297 299300 299299 299301 299294 299451 299444 299442 299441 299439 299440 299443 299449 299448 299445 299446 299447 299450 299437 299420 299421 299422 299425 299424 299423 299426...
output:
31361407 31361404 31361405 31361405 31361406 31361395 31361396 31361395 31361394 31361394 31361393 31361396 31361389 31361395 31361395 31361395 31361396 31361395 31361397 31361396 31361399 31361377 31361393 31361391 31361389 31361389 31361389 31361390 31361391 31361394 31361394 31361394 31361395 313...
result:
ok single line: '31361407 31361404 31361405 313...019 31961020 31961025 31961025 '
Test #61:
score: 0
Accepted
time: 222ms
memory: 84572kb
input:
299998 1237 1241 1240 1238 1239 1242 1229 1236 1234 1235 1231 1232 1233 1230 1261 1246 1254 1252 1253 1249 1247 1248 1251 1250 1257 1255 1256 1258 1245 1244 1243 1260 1259 299996 2665 2622 2621 2623 2624 2625 2620 2619 2618 2626 2616 2615 2617 2608 2609 2603 2604 2605 2601 2602 2606 2607 2595 2596 2...
output:
31071021 31071019 31071018 31071018 31071018 31071016 31071021 31071017 31071018 31071015 31071016 31071016 31071016 31071017 31071000 31071014 31071010 31071011 31071007 31071006 31071006 31071006 31071006 31071009 31071007 31071015 31071015 31071015 31071023 31071022 31071022 31071021 31071026 307...
result:
ok single line: '31071021 31071019 31071018 310...117 31668117 31668126 31668126 '
Test #62:
score: 0
Accepted
time: 205ms
memory: 84740kb
input:
299998 1088 1087 1097 1089 1091 1090 1092 1096 1093 1094 1095 1098 1082 1083 1086 1084 1085 1185 1105 1103 1104 1099 1101 1100 1102 1106 1130 1112 1110 1109 1111 1128 1126 1127 1115 1114 1113 1116 1117 1118 1125 1119 1124 1122 1123 1121 1120 1129 1107 1108 1159 1137 1138 1133 1132 1134 1135 1136 113...
output:
29912323 29912323 29912316 29912318 29912317 29912318 29912318 29912317 29912319 29912319 29912320 29912317 29912328 29912328 29912327 29912328 29912328 29912257 29912270 29912270 29912266 29912267 29912266 29912267 29912267 29912269 29912254 29912257 29912256 29912256 29912256 29912250 29912254 299...
result:
ok single line: '29912323 29912323 29912316 299...869 29912884 29912883 29912883 '
Test #63:
score: 0
Accepted
time: 212ms
memory: 82784kb
input:
300000 233863 298789 297710 24016 84091 294771 125456 278231 37224 256122 151333 101864 46829 22158 49441 187012 151719 275462 294717 294170 100850 38797 211780 249528 226150 261221 278600 288307 284215 265640 244656 44449 38717 130281 178944 207509 217053 153910 52224 187705 227238 226665 225028 21...
output:
6757646 6757637 6757434 6757434 6757434 6757422 6757423 6757413 6757414 6757408 6757407 6757404 6757403 6757403 6757403 6757404 6757409 6757409 6757247 6757073 6757072 6757072 6757072 6757073 6757075 6757075 6757077 6756952 6756875 6756803 6756768 6756767 6756767 6756767 6756769 6756771 6756769 6756...
result:
ok single line: '6757646 6757637 6757434 675743...085120 6085444 6085444 6085444 '
Test #64:
score: 0
Accepted
time: 208ms
memory: 84968kb
input:
300000 16933 81759 291203 240353 88074 296715 296538 261879 194571 112493 116253 249583 158432 153532 111600 237122 33707 173457 248582 238361 121635 124105 157241 40498 78110 164153 164626 57819 109831 228601 1422 266872 221664 250071 99514 281563 258061 134198 22667 108361 271280 224707 211656 207...
output:
6181007 6181007 6181007 6181008 6181008 6180897 6180720 6180711 6180709 6180709 6180709 6180703 6180705 6180704 6180704 6180702 6180705 6180705 6180697 6180692 6180692 6180692 6180691 6180692 6180692 6180693 6180694 6180696 6180696 6180696 6180699 6180697 6180721 6180720 6180721 6180666 6180689 6180...
result:
ok single line: '6181007 6181007 6181007 618100...029111 6029774 6226728 6226728 '
Test #65:
score: 0
Accepted
time: 220ms
memory: 85024kb
input:
300000 99290 84679 300000 299999 23403 299998 294238 271046 232544 231211 183107 173283 128206 94894 85106 79643 72184 59243 38172 16856 24078 75959 38361 76521 121458 132752 133949 135019 137167 139517 159018 162369 161199 89471 170986 197615 210554 223324 215827 232230 248707 217157 84516 249331 2...
output:
57652829 57652829 57352832 57052838 57052838 56752844 56752807 56752769 56752738 56752710 56752689 56752666 56752654 56752653 56752646 56752638 56752637 56752635 56752633 56752633 56752633 56752633 56752638 56752638 56752644 56752655 56752668 56752680 56752681 56752682 56752683 56752683 56752683 567...
result:
ok single line: '57652829 57652829 57352832 570...939 56152941 56152941 56152943 '
Test #66:
score: 0
Accepted
time: 209ms
memory: 85428kb
input:
299997 252240 299995 299993 274570 245357 218755 299988 299987 176922 174672 167134 161535 147805 83909 61904 146502 163619 277486 299986 293601 280747 160191 101691 277617 273586 198623 99407 272484 235688 230848 234191 111873 203910 203613 114043 81937 49480 127700 28153 92306 174094 230166 190450...
output:
39562569 39262587 38962609 38962608 38962607 38962607 38962596 38962531 38962530 38962528 38962522 38962520 38962517 38962516 38962516 38962516 38962518 38962523 38962472 38962429 38962424 38962423 38962423 38962377 38962337 38962336 38962336 38962296 38962294 38962294 38962283 38962284 38962278 389...
result:
ok single line: '39562569 39262587 38962609 389...547 39562554 39562554 39862549 '
Test #67:
score: 0
Accepted
time: 216ms
memory: 84732kb
input:
299997 299997 263506 135538 54134 9170 117514 131728 134906 211588 299996 128605 144585 194353 299994 218943 104209 167072 299993 299992 186448 98482 299989 240104 19648 36373 60245 169695 172704 262833 299986 299984 224182 110731 299982 216356 183921 131763 92083 20274 15967 17110 163764 22101 2692...
output:
366614380 366614373 366614368 366614367 366614367 366614367 366614369 366614371 366614372 366314391 366314399 366314399 366314400 366314397 366314396 366314396 366314396 366014422 365714449 365714448 365714448 365414478 365414475 365414475 365414475 365414476 365414477 365414478 365414479 365114526 ...
result:
ok single line: '366614380 366614373 366614368 ... 366014418 366014422 366014422 '
Test #68:
score: 0
Accepted
time: 0ms
memory: 24568kb
input:
7 7 2 1 4 6 5 3
output:
10 9 9 9 9 10 10
result:
ok single line: '10 9 9 9 9 10 10 '
Test #69:
score: 0
Accepted
time: 221ms
memory: 83700kb
input:
299995 106405 299987 33305 299982 64266 299980 299978 91333 299977 171325 299975 178945 53735 20433 233148 299971 289375 239066 163454 133678 164125 235783 295611 299969 299967 299966 291130 213845 153712 73975 61833 10827 35614 56912 93247 154483 159069 244679 93271 182749 299964 163921 299962 2758...
output:
287596191 287296208 287296209 286996241 286996242 286696279 286396321 286396321 286096362 286096363 285796407 285796407 285796406 285796406 285796406 285496518 285496517 285496513 285496512 285496512 285496512 285496514 285496516 285196649 285196636 284896767 284896755 284896746 284896740 284896737 ...
result:
ok single line: '287596191 287296208 287296209 ... 289396117 289396117 289696110 '
Test #70:
score: 0
Accepted
time: 215ms
memory: 85072kb
input:
299998 152286 152287 152283 152285 152284 152288 152282 152289 152290 152280 152281 152292 152291 152293 152278 152279 152294 152276 152275 152277 152299 152295 152296 152298 152297 152304 152303 152300 152301 152302 152305 152272 152273 152274 152307 152306 152308 152271 152270 152309 152310 152269...
output:
910008 910006 910007 910006 910007 910006 910011 910011 910016 910024 910024 910024 910035 910033 910046 910046 910044 910059 910059 910059 910058 910078 910078 910078 910079 910076 910098 910098 910098 910099 910097 910127 910127 910128 910128 910162 910161 910196 910196 910196 910234 910274 910271...
result:
ok single line: '910008 910006 910007 910006 91... 221802634 221802634 221802653 '
Test #71:
score: 0
Accepted
time: 199ms
memory: 84904kb
input:
300000 299994 299999 299996 299995 299998 299997 300000 299644 299645 299642 299643 299646 299640 299638 299639 299641 299992 299990 299989 299988 299979 299987 299980 299986 299982 299983 299984 299985 299981 299991 299649 299648 299647 299654 299653 299652 299651 299650 299978 299976 299973 299974...
output:
216715386 216715383 216715383 216715383 216715382 216715384 216415391 216415397 216415395 216415396 216415396 216415393 216415394 216415394 216415394 216415395 216415381 216415386 216415384 216415381 216415381 216415376 216415377 216415373 216415374 216415374 216415375 216415375 216415376 216415364 ...
result:
ok single line: '216715386 216715383 216715383 ...17 912019 912017 912017 912017 '
Test #72:
score: 0
Accepted
time: 204ms
memory: 85224kb
input:
299995 299994 299956 299955 299993 299992 299991 299957 299958 299990 299989 299959 299988 299987 299986 299985 299984 299982 299983 299980 299981 299979 299978 299977 299976 299975 299974 299973 299972 299960 299971 299969 299970 299961 299962 299968 299966 299965 299964 299963 299967 299995 299952...
output:
1576465865 1576465864 1576465864 1576465863 1576465862 1576465859 1576465859 1576465859 1576465858 1576465857 1576465857 1576465856 1576465856 1576465855 1576465853 1576465850 1576465850 1576465848 1576465849 1576465848 1576465848 1576465847 1576465846 1576465845 1576465844 1576465843 1576465841 157...
result:
ok single line: '1576465865 1576465864 15764658...87 739487 739486 739487 739487 '
Test #73:
score: 0
Accepted
time: 209ms
memory: 86128kb
input:
300000 142336 142337 142345 142344 142341 142342 142339 142340 142343 142338 142346 142347 142335 142348 142334 142349 142350 142351 142333 142353 142352 142354 142356 142355 142357 142332 142358 142331 142360 142359 142362 142361 142365 142364 142363 142368 142366 142367 142369 142330 142329 142370...
output:
739469 739469 739466 739463 739463 739461 739462 739462 739462 739465 739465 739474 739485 739484 739497 739497 739512 739527 739544 739543 739562 739562 739582 739604 739603 739627 739626 739652 739651 739679 739678 739708 739707 739738 739738 739736 739771 739771 739771 739808 739808 739807 739848...
result:
ok single line: '739469 739469 739466 739463 73...88942164 1588942165 1588942167 '
Test #74:
score: 0
Accepted
time: 191ms
memory: 87656kb
input:
300000 131485 131486 131484 131487 131483 131482 131488 131489 131481 131480 131490 131491 131492 131493 131495 131494 131496 131479 131497 131478 131499 131498 131500 131502 131501 131504 131503 131505 131477 131506 131508 131507 131509 131476 131511 131510 131512 131514 131513 131515 131516 131517...
output:
713734 713733 713734 713733 713735 713735 713735 713740 713746 713746 713746 713756 713767 713779 713791 713805 713804 713820 713819 713837 713836 713856 713856 713877 713900 713899 713924 713923 713950 713950 713978 714008 714007 714039 714038 714072 714072 714107 714144 714144 714183 714222 714263...
result:
ok single line: '713734 713733 713734 713733 71...87702305 4287702306 4287702307 '
Test #75:
score: 0
Accepted
time: 197ms
memory: 87776kb
input:
299996 132485 132494 132491 132489 132490 132492 132493 132487 132486 132488 132495 132496 132497 132498 132499 132500 132484 132501 132502 132503 132505 132504 132506 132507 132508 132509 132510 132511 132513 132512 132515 132514 132516 132483 132517 132518 132482 132519 132520 132481 132521 132523...
output:
713154 713148 713147 713147 713147 713148 713148 713149 713149 713149 713151 713161 713172 713184 713197 713210 713225 713225 713242 713260 713278 713298 713298 713320 713343 713367 713392 713418 713444 713472 713471 713501 713500 713532 713532 713565 713600 713600 713636 713674 713674 713713 713754...
result:
ok single line: '713154 713148 713147 713147 71...14751907 4314751908 4314751909 '
Test #76:
score: 0
Accepted
time: 116ms
memory: 63136kb
input:
179228 169663 108607 149640 116457 26258 76839 16848 11020 168393 86108 60980 38208 56226 53886 48964 103993 80290 6236 126771 46506 118599 37901 169521 2964 17768 168300 161541 70490 59833 89050 130986 45736 136440 121369 133878 168989 145597 87969 151404 34313 98446 153196 147632 3243 128234 80808...
output:
1586366 1586366 1586364 1586363 1586363 1586362 1586362 1586362 1586351 1586355 1586353 1586353 1586352 1586352 1586352 1586351 1586356 1586356 1586354 1586362 1586361 1586362 1586345 1586364 1586364 1586360 1586354 1586353 1586353 1586353 1586354 1586356 1586354 1586356 1586356 1586351 1586360 1586...
result:
ok single line: '1586366 1586366 1586364 158636...527661 1527671 1527670 1527671 '
Test #77:
score: 0
Accepted
time: 208ms
memory: 84772kb
input:
298373 113457 243827 56438 38582 281665 117901 71884 16914 2155 219362 89294 56083 109999 155407 109148 156059 238656 5955 229213 272838 101195 14471 11708 12454 253048 71827 255835 260325 133870 161797 205372 140987 117290 159060 199103 256480 235965 145969 272889 171502 25111 297066 93173 95244 11...
output:
2474348 2474347 2474347 2474347 2474313 2474316 2474315 2474314 2474314 2474308 2474311 2474311 2474311 2474312 2474314 2474314 2474314 2474324 2474324 2474311 2474314 2474312 2474312 2474312 2474312 2474316 2474316 2474313 2474315 2474315 2474312 2474312 2474312 2474312 2474314 2474315 2474319 2474...
result:
ok single line: '2474348 2474347 2474347 247434...044964 3044965 3044965 3044966 '
Test #78:
score: 0
Accepted
time: 185ms
memory: 84624kb
input:
292652 21377 63492 290500 94294 56124 261191 247042 262583 159872 290786 237019 222285 178398 206185 211770 192129 81873 265055 143619 93618 63604 11745 52665 159823 107068 106058 251493 99242 169697 232194 252525 148034 28377 177262 38641 112526 32768 190872 188041 158336 88280 273251 194388 189650...
output:
2573900 2573900 2573896 2573897 2573897 2573896 2573898 2573897 2573900 2573735 2573741 2573738 2573738 2573738 2573738 2573738 2573738 2573721 2573727 2573725 2573723 2573723 2573723 2573723 2573727 2573727 2573724 2573731 2573731 2573732 2573726 2573731 2573731 2573729 2573731 2573730 2573731 2573...
result:
ok single line: '2573900 2573900 2573896 257389...753728 2753728 2753728 2753731 '
Test #79:
score: 0
Accepted
time: 2ms
memory: 24012kb
input:
12 7 2 1 5 4 12 10 6 11 9 8 3
output:
26 25 25 24 26 20 24 24 21 21 20 20
result:
ok single line: '26 25 25 24 26 20 24 24 21 21 20 20 '
Test #80:
score: 0
Accepted
time: 207ms
memory: 81448kb
input:
288487 112614 206908 199249 143412 170007 75297 102958 253346 233796 126292 202609 215242 92605 90403 21900 108017 31569 237342 155237 214803 285450 168483 126056 115201 251953 212554 196155 270435 279995 184596 64141 62533 100806 35737 179883 214283 243107 43004 179387 182500 90408 139312 205142 27...
output:
2656317 2656315 2656313 2656313 2656311 2656312 2656312 2656302 2656305 2656305 2656305 2656302 2656302 2656301 2656301 2656300 2656303 2656301 2656310 2656310 2656274 2656293 2656292 2656292 2656291 2656293 2656293 2656293 2656280 2656278 2656277 2656277 2656276 2656278 2656278 2656281 2656281 2656...
result:
ok single line: '2656317 2656315 2656313 265631...493698 2493702 2493701 2493702 '
Test #81:
score: 0
Accepted
time: 2ms
memory: 23828kb
input:
21 16 11 19 8 17 5 12 1 18 13 20 14 15 6 7 4 2 21 9 10 3
output:
41 41 35 37 35 36 35 36 35 39 36 46 44 45 44 44 44 41 58 57 58
result:
ok single line: '41 41 35 37 35 36 35 36 35 39 36 46 44 45 44 44 44 41 58 57 58 '
Extra Test:
score: 0
Extra Test Passed