QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#824911 | #9772. Permutation Routing | ucup-team3161# | RE | 67ms | 28964kb | C++14 | 3.7kb | 2024-12-21 16:28:29 | 2025-01-10 11:38:33 |
Judging History
answer
// what is matter? never mind.
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2")
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
//#define ull unsigned long long
#define int long long
#define SZ(x) ((int)((x).size()))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
inline int read()
{
char c=getchar();int x=0;bool f=0;
for(;!isdigit(c);c=getchar())f^=!(c^45);
for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
return f?-x:x;
}
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;
#define maxn 100005
#define inf 0x3f3f3f3f
int n,m,p[maxn];
vi e[maxn];
int vis[maxn],nowt,rt;
int fa[maxn],sz[maxn],mxp[maxn],allsz;
void getrt(int u,int pa){
sz[u]=1;
mxp[u]=0;
for(int v:e[u]){
if(v!=pa&&vis[v]==nowt){
getrt(v,u);
sz[u]+=sz[v];
mxp[u]=max(mxp[u],sz[v]);
}
}
mxp[u]=max(mxp[u],allsz-sz[u]);
if(mxp[u]<mxp[rt])rt=u;
}
int col[maxn];
void dfs(int u,int pa,int qwq){
col[u]=qwq;
fa[u]=pa;
for(int v:e[u]){
if(v!=pa && vis[v]==nowt){
dfs(v,u,qwq);
}
}
}
int NOW;
vector< vector<pii> >vec;
vector<pii>stk;
void dostk(){
for(auto [u,v]:stk) swap(p[u],p[v]);
stk.clear();
}
int vis2[maxn];
void add(int T,int u,int v){
while(vec.size()<T) vec.pb({});
vec[T-1].pb(mkp(u,v));
stk.pb(mkp(u,v));
vis2[u]=vis2[v]=1;
}
void dfs2(int u,int pa){
for(int v:e[u]) if(v!=pa && col[v]==col[u]) {
dfs2(v,u);
if(!vis2[u] && !vis2[v] && col[v]!=col[p[v]] && col[u]==col[p[u]]){
add(NOW,u,v);
}
}
}
void solve(vi o,int T)
{
if(!o.size()) return;
if(o.size()==1) return;
if(o.size()==2){
int u=o[0],v=o[1];
if(p[u]!=u){
add(T,u,v);
dostk();
return;
}
return;
}
// cout<<"solve "<<T<<endl;
// for(int x:o) cout<<x<<" "; cout<<"\n";
// for(int x:o) cout<<p[x]<<" "; cout<<"\n";
++nowt;
for(int u:o)vis[u]=nowt;
allsz=o.size();
mxp[rt=0]=inf;
getrt(o[0],0);
getrt(rt,0);
pii mnsz=mkp(inf,inf);
for(int u:e[rt]) if(vis[u]==nowt) {
dfs(u,rt,u);
mnsz=min(mnsz,mkp(sz[u],u));
}
col[rt]=col[mnsz.se];
vi sons;
sons.pb(rt);
for(int u:e[rt]) if(vis[u]==nowt && u!=mnsz.se) sons.pb(u);
auto chk=[&](){
for(int u:o)
if(col[u]!=col[p[u]]) return 0;
return 1;
};
while(!chk()){
++T;
NOW=T;
for(int u:o) vis2[u]=0;
for(int u:sons) dfs2(u,0);
if(!vis2[rt]){
for(int u:sons) if(u!=rt && !vis2[u] && !vis2[rt] && col[p[rt]]==col[u] && col[p[u]]!=col[u]) {
add(NOW,rt,u);
break;
}
for(int u:sons) if(u!=rt && !vis2[u] && !vis2[rt] && col[p[u]]!=col[u]) {
add(NOW,rt,u);
break;
}
}
dostk();
}
vector<vi> mys;
for(int u:sons){
vi nxt;
for(int v:o) if(col[v]==col[u]) nxt.pb(v);
mys.pb(nxt);
if(!nxt.size()){
cout<<"u: "<<u<<endl;
puts("???");
}
}
for(auto it:mys) solve(it,T+1);
}
int mp[1005][1005];
void work()
{
n=read();
For(i,1,n)e[i].clear(); vec.clear();
For(i,1,n)p[i]=read();
For(i,1,n-1){
int u=read(),v=read();
mp[u][v]=mp[v][u]=i;
e[u].pb(v),e[v].pb(u);
}
vi o;
For(i,1,n) o.pb(i);
solve(o,0);
// For(i,1,n) cout<<p[i]<<" "; cout<<" p\n";
cout<<vec.size()<<"\n";
for(auto it:vec){
cout<<it.size()<<" ";
for(auto [x,y]:it) cout<<mp[x][y]<<" ";
cout<<"\n";
}
}
signed main()
{
int T=read();
while(T--)work();
return 0;
}
/*
1
10
10 1 7 8 6 5 2 9 4 3
1 2
2 3
2 4
1 5
2 6
4 8
3 9
6 10
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 11836kb
input:
1 5 1 4 2 5 3 1 2 2 3 2 4 1 5
output:
3 2 4 3 1 1 2 2 4
result:
ok ok, up to 3 steps were used
Test #2:
score: 0
Accepted
time: 18ms
memory: 11836kb
input:
10000 5 2 3 1 5 4 1 5 3 2 1 2 1 4 5 1 2 3 4 5 2 3 3 4 2 1 4 5 5 4 2 5 1 3 3 5 2 3 4 1 3 1 5 1 3 4 2 5 5 3 2 1 1 3 2 4 5 1 2 3 4 5 2 1 3 5 2 3 5 4 5 1 2 3 4 5 4 5 3 4 4 2 4 1 5 5 2 1 4 3 2 1 5 1 3 1 1 4 5 4 1 2 5 3 3 1 5 1 1 2 1 4 5 5 3 4 2 1 3 1 3 5 4 3 3 2 5 3 4 1 2 5 3 2 3 5 1 5 3 4 5 3 4 1 2 5 2 ...
output:
4 2 2 1 1 4 1 1 1 3 0 2 1 1 1 3 5 1 2 1 3 0 1 2 1 4 0 0 2 1 2 1 3 4 1 4 1 2 1 1 1 3 5 1 3 1 4 1 1 1 2 1 1 5 2 3 4 1 1 1 4 1 2 1 3 3 1 2 2 4 1 1 2 3 1 1 1 4 1 2 0 8 1 2 2 4 3 2 2 1 1 3 1 1 1 4 1 2 1 4 6 2 3 2 1 1 1 2 0 1 3 1 1 2 1 2 1 1 0 0 0 4 1 2 2 ...
result:
ok ok, up to 8 steps were used
Test #3:
score: 0
Accepted
time: 56ms
memory: 10632kb
input:
10000 10 2 7 5 6 4 8 3 1 10 9 8 10 6 1 5 6 4 7 10 2 6 8 7 6 5 3 9 8 10 4 10 6 1 8 3 9 5 7 2 3 10 9 10 5 10 4 6 10 8 10 4 7 10 4 2 4 1 10 9 7 5 10 3 8 2 6 1 4 10 3 9 3 6 3 7 3 4 3 2 3 5 2 3 8 3 1 10 10 9 5 6 3 4 8 7 2 1 2 6 7 8 5 2 4 9 9 3 3 8 8 5 6 10 4 1 10 2 1 6 7 10 3 4 9 8 5 10 3 3 5 1 3 3 2 3 9...
output:
11 2 5 6 2 2 1 1 6 1 7 2 4 3 1 7 2 8 4 1 1 2 9 5 1 1 1 9 12 2 4 2 1 7 1 2 1 6 2 1 8 1 6 1 3 1 5 1 3 0 1 4 1 9 12 1 6 2 7 4 1 6 1 9 1 2 1 1 1 5 1 1 1 3 1 8 1 3 1 9 17 1 6 1 7 2 3 6 3 5 1 7 3 4 8 6 3 9 5 7 3 4 3 6 2 1 7 2 3 6 2 5 7 1 6 1 7 1 2 2 4 1 4 5...
result:
ok ok, up to 21 steps were used
Test #4:
score: 0
Accepted
time: 41ms
memory: 12260kb
input:
2500 20 19 16 18 14 10 3 6 8 9 20 11 1 13 5 4 17 12 15 7 2 14 9 11 1 7 16 9 5 3 1 16 19 15 4 6 9 7 2 12 15 8 5 20 19 16 9 18 1 1 17 1 15 13 15 9 10 1 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 5 14 6 10 12 14 9 1 13 1 18 15 7 10 7 12 17 4 4 5 16 9 11 10 18 8 13 19 6 20 2 4 3 4 15 11 8 ...
output:
15 3 8 7 6 2 13 19 3 12 18 16 1 6 2 13 19 1 6 1 12 2 13 5 3 3 1 14 2 4 16 3 18 10 15 2 13 16 1 8 2 9 10 1 3 0 0 30 2 11 13 3 14 4 10 4 9 6 11 13 5 12 14 19 4 10 6 18 9 1 6 11 13 6 5 12 14 19 4 10 6 8 18 9 6 11 13 6 15 5 12 14 4 10 6 3 8 18 9 11 13 6 15 5 12 14 16 10 6 8 18 9...
result:
ok ok, up to 47 steps were used
Test #5:
score: 0
Accepted
time: 30ms
memory: 12452kb
input:
400 50 18 35 3 1 22 2 29 14 27 44 32 4 34 43 33 23 21 48 13 47 46 50 38 12 49 9 11 31 10 8 37 41 42 36 17 15 45 16 24 40 25 30 19 28 7 39 5 20 6 26 45 32 39 28 27 43 29 39 34 40 17 12 8 38 3 23 5 41 40 8 36 43 41 25 19 1 18 43 1 46 28 4 39 11 42 20 44 40 35 43 50 43 15 9 31 20 35 37 22 42 29 30 21 2...
output:
59 4 8 5 9 47 3 19 31 35 3 2 10 43 3 16 21 47 3 3 19 43 3 48 21 39 4 13 18 3 47 4 15 48 28 30 3 33 44 47 3 9 28 43 3 21 44 35 4 2 3 12 43 3 38 21 35 3 2 11 39 2 13 43 2 21 47 3 14 28 43 3 21 44 35 4 4 20 46 43 4 26 24 21 35 4 4 34 20 47 4 27 24 28 35 3 4 44 47 2 28 30 2 37 35...
result:
ok ok, up to 123 steps were used
Test #6:
score: 0
Accepted
time: 22ms
memory: 14568kb
input:
400 50 16 19 35 42 20 8 28 6 25 15 49 31 24 34 10 1 50 33 2 5 26 46 27 13 9 21 23 7 30 29 12 44 18 14 3 40 45 48 43 36 47 4 39 32 37 22 41 38 11 17 13 24 1 43 6 10 12 47 21 47 17 13 2 20 10 8 35 33 5 13 1 20 23 40 13 14 47 9 49 2 42 41 10 42 8 3 27 34 42 29 46 48 46 14 23 42 1 36 26 31 33 14 2 50 7 ...
output:
63 7 6 18 33 34 9 36 2 3 8 11 46 4 30 7 45 22 4 13 21 27 2 4 10 33 11 46 5 49 13 8 7 45 3 10 2 46 3 13 11 45 3 29 2 46 3 13 24 45 4 35 44 2 22 4 13 21 19 24 4 42 33 44 46 3 13 17 45 3 16 2 22 3 21 24 26 3 33 48 22 4 17 21 4 46 4 23 33 45 22 5 12 17 21 2 46 5 23 33 31 45 22 4 17 ...
result:
ok ok, up to 124 steps were used
Test #7:
score: 0
Accepted
time: 22ms
memory: 12472kb
input:
100 100 49 90 5 62 95 42 92 16 74 58 66 85 21 98 15 6 73 13 40 78 44 2 93 11 54 76 80 34 89 96 31 56 67 77 79 39 26 14 23 81 3 69 37 97 83 25 12 22 61 48 17 84 35 47 36 53 7 91 60 100 82 57 4 99 45 28 70 72 59 86 33 64 75 41 94 51 29 46 20 8 24 52 1 43 19 27 38 10 55 68 32 71 65 9 30 88 18 87 63 50 ...
output:
111 13 95 10 65 35 30 52 82 73 7 60 72 33 8 6 11 22 2 51 23 37 4 4 92 30 8 3 38 2 68 3 24 6 37 4 80 30 13 68 5 85 49 1 6 63 4 15 12 13 8 3 38 99 68 3 24 6 8 4 80 38 13 63 3 24 45 8 3 38 16 63 4 75 52 45 68 3 16 6 37 4 30 96 32 63 3 49 45 68 3 16 6 8 3 38 59 37 2 30 8 3 41 79 68 ...
result:
ok ok, up to 258 steps were used
Test #8:
score: 0
Accepted
time: 23ms
memory: 12456kb
input:
100 100 86 35 82 12 83 29 60 50 90 33 87 4 47 51 70 96 48 31 89 84 92 37 55 94 78 80 57 46 6 99 18 74 10 38 2 63 22 34 67 77 72 44 68 42 79 28 13 17 62 8 14 91 97 98 23 66 27 69 100 7 75 49 36 73 88 56 39 43 58 15 85 41 64 32 61 95 40 25 45 26 93 3 5 20 71 1 11 65 19 9 52 21 81 24 76 16 53 54 30 59 ...
output:
134 9 6 10 45 43 19 3 8 7 83 4 57 2 82 61 2 23 83 2 9 61 3 67 44 18 4 95 39 79 42 4 72 4 60 18 3 40 39 22 3 1 19 83 2 9 18 3 73 44 83 3 69 9 22 3 48 44 18 3 74 13 83 3 12 9 61 3 67 64 18 3 74 79 83 4 99 77 9 18 3 26 74 61 3 99 67 18 4 68 74 79 83 4 99 80 35 22 4 87 48 86 83 4 ...
result:
ok ok, up to 250 steps were used
Test #9:
score: 0
Accepted
time: 4ms
memory: 18872kb
input:
1 1000 852 223 408 154 361 680 77 982 706 853 792 191 955 586 379 419 503 697 500 694 599 90 782 234 186 750 322 213 91 315 882 420 605 177 968 269 175 386 69 825 488 696 58 316 877 885 375 872 589 109 75 263 442 760 273 663 547 43 426 372 844 579 425 777 865 878 409 466 39 286 538 726 771 401 51 75...
output:
1181 104 395 140 136 556 239 201 882 432 221 338 906 486 30 428 423 585 186 170 901 75 900 130 366 384 84 375 85 904 343 69 256 474 772 760 312 994 687 870 183 163 45 37 917 268 257 44 453 361 38 111 54 329 410 222 833 480 950 623 194 523 414 438 697 142 597 652 209 115 93 135 292 581 762 430 734 74...
result:
ok ok, up to 1181 steps were used
Test #10:
score: 0
Accepted
time: 7ms
memory: 17344kb
input:
1 1000 690 995 868 467 793 949 539 17 557 637 246 77 677 681 714 642 40 43 69 594 433 612 283 865 152 907 30 486 979 253 139 227 810 478 932 439 202 508 388 901 705 821 822 209 920 725 133 469 165 205 16 403 598 858 198 81 954 600 7 387 335 178 658 859 115 905 166 55 127 745 738 144 511 383 648 452 ...
output:
1246 156 501 708 245 512 105 624 55 846 850 650 474 194 200 258 923 499 528 556 943 610 173 195 780 262 144 136 321 503 409 826 57 725 808 894 462 374 19 104 623 207 444 884 730 927 238 326 859 208 72 12 546 577 139 150 628 548 141 436 221 666 22 891 507 467 16 957 944 815 656 903 413 109 746 234 44...
result:
ok ok, up to 1246 steps were used
Test #11:
score: 0
Accepted
time: 16ms
memory: 20260kb
input:
1 1000 981 206 539 504 568 390 696 919 303 771 71 524 891 51 96 748 158 236 88 633 652 740 616 762 348 636 53 479 509 409 557 920 738 326 224 592 898 867 522 530 953 939 793 657 819 1 110 500 200 170 559 435 627 589 560 551 359 323 787 30 239 783 650 442 969 68 459 830 966 380 630 482 550 352 14 929...
output:
1146 201 666 1 15 550 59 182 858 124 932 953 286 450 202 329 762 241 219 510 126 464 190 488 78 433 817 305 150 735 750 667 799 602 567 246 196 538 707 8 226 19 833 480 776 901 145 9 576 407 331 2 742 914 445 481 76 982 65 163 700 18 535 867 82 698 102 39 140 303 665 122 949 378 354 590 304 478 441 ...
result:
ok ok, up to 1146 steps were used
Test #12:
score: 0
Accepted
time: 32ms
memory: 20892kb
input:
1 1000 327 708 701 120 714 171 723 70 98 93 402 303 137 145 936 525 741 99 328 656 48 553 753 783 945 254 547 405 823 842 844 822 690 206 436 6 919 560 267 886 613 147 810 908 771 130 407 893 578 439 929 426 59 879 738 770 156 651 323 119 697 357 884 599 990 347 172 590 545 438 223 677 663 363 115 2...
output:
1173 248 906 304 625 682 162 729 46 424 358 406 5 863 19 757 96 82 15 705 611 795 421 829 185 594 332 16 875 23 288 2 877 222 472 474 353 606 782 159 253 37 29 859 224 478 588 951 623 486 282 291 639 267 157 147 249 954 570 846 491 178 690 281 669 526 715 728 869 179 34 948 547 941 168 646 522 326 8...
result:
ok ok, up to 1173 steps were used
Test #13:
score: 0
Accepted
time: 35ms
memory: 23960kb
input:
1 1000 332 858 822 192 770 336 467 401 841 606 399 550 239 834 383 300 497 970 19 542 688 478 994 273 553 541 676 654 667 348 904 906 986 21 997 900 437 684 568 44 634 216 120 333 123 231 42 631 488 442 435 824 12 93 774 877 203 490 15 565 151 413 567 782 777 484 861 206 188 707 334 374 99 136 178 5...
output:
1077 254 601 251 685 25 526 471 258 879 803 382 4 799 904 503 510 778 209 966 473 9 16 843 371 706 300 192 235 882 345 265 782 745 24 210 254 277 919 181 663 126 168 449 797 299 924 453 311 683 842 883 52 116 92 942 98 621 737 157 652 69 377 573 522 1 769 810 664 644 362 888 690 865 27 509 75 155 43...
result:
ok ok, up to 1077 steps were used
Test #14:
score: 0
Accepted
time: 6ms
memory: 18608kb
input:
1 1000 115 372 488 59 513 596 934 677 862 54 696 855 901 825 265 417 899 693 490 203 536 735 402 875 289 510 793 522 199 695 25 726 710 422 137 572 274 881 374 755 163 295 343 219 888 205 597 454 806 39 782 138 889 344 858 160 7 72 185 815 820 830 968 795 691 217 271 772 646 546 840 998 520 670 777 ...
output:
1108 8 125 10 182 32 352 101 717 515 2 192 207 2 36 329 2 50 848 1 489 2 328 814 2 505 43 1 251 2 17 965 2 23 41 2 121 655 2 57 56 3 75 5 709 2 78 276 2 16 44 2 86 61 2 262 903 2 6 591 2 215 606 2 8 771 2 7 273 2 4 705 2 46 606 2 31 276 2 37 606 2 48 874 2 73 850 2 361 276...
result:
ok ok, up to 1108 steps were used
Test #15:
score: 0
Accepted
time: 8ms
memory: 16724kb
input:
1 1000 717 305 986 429 917 628 985 204 341 749 852 307 820 711 484 562 866 473 800 40 241 127 71 565 310 808 480 925 987 250 755 125 848 535 479 295 383 188 375 640 646 466 842 813 752 203 704 831 919 315 994 817 676 386 157 830 374 355 795 60 995 758 814 745 778 681 964 1 279 512 636 862 665 298 68...
output:
1096 1 154 2 5 906 2 25 198 2 39 154 2 6 307 1 987 2 42 991 1 152 1 976 2 388 304 1 906 2 26 535 2 2 416 1 850 2 22 154 2 20 303 1 835 2 8 850 2 71 285 1 154 2 23 906 2 30 110 2 3 216 1 110 2 27 535 2 24 713 2 46 799 1 597 2 62 154 2 35 164 1 185 1 154 2 49 535 2 32 ...
result:
ok ok, up to 1096 steps were used
Test #16:
score: 0
Accepted
time: 4ms
memory: 18576kb
input:
1 1000 310 363 446 303 748 979 8 485 694 948 702 771 36 191 666 891 559 413 845 895 827 67 498 658 971 868 473 674 913 421 65 377 692 536 802 467 237 292 22 967 732 660 275 490 690 672 128 577 833 107 810 353 392 958 824 15 158 243 901 991 717 344 904 565 350 881 641 512 898 159 633 999 422 501 528 ...
output:
1096 1 707 1 417 1 599 1 778 1 126 1 92 1 576 1 172 1 763 1 124 1 785 1 409 1 649 1 481 1 984 1 381 1 60 1 424 1 198 1 285 1 828 1 825 1 311 1 855 1 890 1 133 1 675 1 819 1 444 1 544 1 306 1 814 1 298 1 698 1 955 1 667 1 852 1 431 1 590 1 404 1 630 2 34 176 ...
result:
ok ok, up to 1096 steps were used
Test #17:
score: 0
Accepted
time: 4ms
memory: 15664kb
input:
1 1000 77 278 871 920 284 552 661 728 2 158 428 62 898 909 18 496 195 754 63 957 946 772 703 82 394 806 701 197 941 758 665 573 982 308 736 389 423 616 416 530 874 618 494 436 322 939 447 631 391 136 208 985 681 424 529 393 595 19 841 30 461 605 440 132 587 825 848 869 107 512 364 169 872 679 849 75...
output:
1005 1 880 1 181 1 732 1 155 1 201 1 493 1 39 1 663 1 242 1 425 1 696 1 728 1 394 1 642 1 436 1 5 1 123 1 483 1 589 1 395 1 667 1 579 1 513 1 423 1 411 1 994 1 817 1 958 1 275 1 424 1 28 1 941 1 264 1 568 1 621 1 901 1 646 1 252 1 991 1 778 1 509 1 12 1 928 ...
result:
ok ok, up to 1005 steps were used
Test #18:
score: 0
Accepted
time: 8ms
memory: 18780kb
input:
1 999 977 98 254 594 144 861 64 706 322 185 959 376 323 840 42 799 653 762 698 150 162 58 530 189 649 112 430 341 515 303 837 657 344 232 290 867 137 352 716 755 488 15 919 250 49 597 127 420 45 693 314 384 170 745 536 312 178 22 141 79 266 84 80 7 545 210 616 748 843 225 487 588 418 229 414 689 575...
output:
1417 100 150 358 500 821 182 354 186 3 107 446 532 343 515 139 989 574 262 273 501 491 346 357 883 268 572 656 544 24 143 373 916 686 628 85 865 648 77 359 722 426 738 746 198 667 79 193 479 141 747 779 170 265 795 846 344 789 617 972 396 20 412 597 400 65 603 116 174 16 183 146 535 814 423 31 127 8...
result:
ok ok, up to 1417 steps were used
Test #19:
score: 0
Accepted
time: 13ms
memory: 17260kb
input:
1 999 266 532 27 286 491 460 989 270 745 828 710 910 428 608 178 855 803 851 719 938 627 684 584 661 547 827 3 641 771 223 567 241 275 476 933 417 287 705 545 272 904 572 747 92 589 168 384 613 928 237 936 728 870 349 724 183 617 624 626 240 508 354 538 578 133 190 477 787 308 120 323 590 798 664 11...
output:
1223 157 161 263 880 819 39 232 193 444 212 18 108 500 394 837 24 418 154 619 749 586 868 140 458 298 9 552 157 166 320 59 34 924 461 41 614 584 756 265 383 280 629 355 100 465 282 49 669 276 328 746 346 736 830 128 928 990 734 664 674 582 755 121 373 178 667 499 491 337 848 642 171 639 624 77 901 1...
result:
ok ok, up to 1223 steps were used
Test #20:
score: 0
Accepted
time: 21ms
memory: 20768kb
input:
1 999 32 791 286 948 176 560 246 200 367 339 179 369 474 328 772 886 982 954 604 262 944 602 491 965 585 408 970 638 686 896 769 1 873 703 444 658 348 96 891 514 118 78 52 904 469 851 956 468 996 299 64 43 311 539 738 927 788 224 959 79 141 940 967 51 376 244 343 350 379 949 421 844 382 775 465 414 ...
output:
1553 6 591 358 954 550 312 380 3 756 7 746 4 204 374 312 380 5 3 164 954 7 746 5 420 756 374 312 380 5 586 204 954 7 746 6 833 164 756 374 312 380 6 513 586 204 954 7 746 6 447 452 833 756 374 312 6 470 513 700 954 7 746 5 626 756 374 312 380 6 586 251 700 954 7 746 7 833 295 626 756 374...
result:
ok ok, up to 1553 steps were used
Test #21:
score: 0
Accepted
time: 56ms
memory: 27332kb
input:
1 999 162 333 835 598 275 157 150 732 33 26 263 815 589 327 515 530 581 239 565 251 126 705 855 155 382 10 406 185 599 802 445 661 9 600 74 574 163 952 474 462 340 125 250 137 992 660 727 407 486 226 612 287 658 945 82 399 416 939 171 838 120 644 194 114 752 831 351 413 96 316 317 946 109 35 318 692...
output:
2129 1 555 2 482 316 3 683 555 468 4 1 482 448 316 4 589 683 555 468 3 1 482 316 4 885 683 555 620 5 229 1 482 185 316 6 605 885 683 555 192 620 7 182 229 1 482 703 185 316 7 605 885 683 555 955 192 620 8 597 229 1 482 565 703 185 316 9 797 605 885 683 555 121 955 192 620 10 993 597 229...
result:
ok ok, up to 2129 steps were used
Test #22:
score: 0
Accepted
time: 67ms
memory: 28964kb
input:
1 999 709 23 572 330 7 668 5 576 217 663 840 634 47 731 182 724 413 574 38 225 459 739 2 609 234 281 537 76 718 403 800 529 979 913 75 661 134 19 83 445 90 810 248 583 348 478 13 695 392 623 894 550 631 523 783 373 111 431 425 652 487 253 719 98 854 711 130 588 686 159 903 753 836 222 35 28 749 817 ...
output:
1997 1 212 2 186 809 3 72 212 798 4 752 186 99 809 5 969 72 212 362 798 6 650 752 186 55 99 809 7 947 969 72 212 732 362 798 8 804 650 752 186 344 55 99 809 9 591 947 969 72 212 836 732 362 798 10 272 804 650 752 186 754 344 55 99 809 11 314 591 947 969 72 212 525 836 732 362 798 12 826 2...
result:
ok ok, up to 1997 steps were used
Test #23:
score: 0
Accepted
time: 6ms
memory: 18800kb
input:
1 999 719 626 485 972 276 492 226 237 77 102 843 188 386 650 123 976 24 861 233 391 973 29 543 17 172 468 927 588 22 141 119 566 98 700 769 282 271 432 956 995 692 837 308 848 180 216 442 482 451 793 913 942 362 463 729 64 983 965 986 259 345 890 534 56 152 450 266 647 300 326 759 900 254 929 786 35...
output:
1175 7 18 78 166 479 85 264 635 3 105 9 338 2 26 14 2 18 405 3 137 1 190 2 143 693 2 4 338 2 39 896 2 21 338 2 58 405 2 44 14 2 18 13 3 34 545 726 2 33 192 3 29 600 273 2 20 157 1 273 2 119 682 2 15 124 2 448 907 2 235 727 2 57 14 2 18 682 3 552 24 865 2 116 256 2 7 405 2 4...
result:
ok ok, up to 1175 steps were used
Test #24:
score: 0
Accepted
time: 4ms
memory: 18792kb
input:
1 999 759 723 437 606 248 905 512 502 912 612 469 81 971 736 446 481 888 903 672 823 229 900 959 148 532 220 225 849 241 943 88 263 810 228 915 45 934 167 89 879 782 859 315 426 36 252 451 142 604 894 910 549 677 561 57 476 55 427 682 652 120 352 779 292 289 815 996 590 923 435 796 366 855 181 507 9...
output:
1141 2 5 540 1 843 1 944 2 3 426 2 2 190 2 17 500 2 7 190 2 36 172 2 79 190 2 77 785 1 190 2 86 381 2 11 682 2 282 586 2 234 678 2 20 899 2 1 426 2 63 500 2 24 632 2 6 426 2 84 632 2 14 500 2 28 632 2 21 944 2 10 500 2 37 249 1 500 2 46 944 2 15 899 2 48 756 1 899 2 60...
result:
ok ok, up to 1141 steps were used
Test #25:
score: 0
Accepted
time: 5ms
memory: 18792kb
input:
1 999 920 435 55 749 629 95 418 187 971 806 239 760 641 396 219 47 777 413 500 229 271 182 571 754 162 624 935 790 755 646 739 447 341 949 485 236 193 363 315 633 463 656 852 129 126 696 16 710 961 542 59 156 483 841 3 246 992 972 51 947 651 969 405 516 85 821 71 487 848 98 67 857 709 281 895 825 14...
output:
1473 2 20 369 1 508 1 702 1 1 1 186 1 1 1 2 1 628 1 2 1 3 1 717 1 3 1 4 1 410 1 4 1 5 1 732 1 5 1 6 1 919 1 6 1 7 1 989 2 15 194 1 989 2 16 718 1 989 2 28 735 1 989 2 36 501 1 989 2 65 714 1 989 2 85 255 1 989 2 89 519 1 989 2 91 631 1 989 2 108 252 1 989 2 1...
result:
ok ok, up to 1473 steps were used
Test #26:
score: 0
Accepted
time: 10ms
memory: 16000kb
input:
1 999 311 242 610 99 258 592 164 715 179 45 161 139 499 398 738 170 404 234 445 395 63 33 968 301 323 568 938 447 721 855 584 645 22 601 300 710 279 923 700 265 380 489 853 613 10 297 166 574 324 278 152 407 263 187 117 798 340 470 202 221 411 622 21 876 820 659 261 885 405 905 831 289 126 237 825 2...
output:
1495 1 467 1 930 1 279 1 1 1 634 1 1 1 2 1 129 1 2 1 3 1 465 1 3 1 4 1 868 1 4 1 5 1 865 1 5 1 6 1 349 1 6 1 7 1 505 1 7 1 8 1 158 1 8 1 9 1 274 1 9 1 10 1 141 1 10 1 11 1 510 1 11 1 12 1 960 1 12 1 13 1 764 1 13 1 14 1 788 1 14 1 15 1 961 1 15 1 16 1...
result:
ok ok, up to 1495 steps were used
Test #27:
score: 0
Accepted
time: 8ms
memory: 19496kb
input:
1 998 948 460 335 899 872 723 754 646 789 772 119 382 651 383 942 755 774 997 446 970 867 949 471 67 935 391 875 632 727 992 366 915 369 88 207 889 918 511 526 138 792 384 967 388 162 661 179 375 304 897 559 368 688 907 267 531 787 573 817 943 530 278 677 814 327 850 24 606 339 37 435 578 75 169 73 ...
output:
1201 146 478 13 198 926 69 314 311 131 97 707 753 45 514 717 540 534 652 807 462 948 914 494 380 466 284 663 713 699 492 223 181 472 747 548 844 41 236 123 21 774 133 702 331 983 874 368 852 118 524 98 112 355 308 678 654 862 103 1 49 296 817 816 739 81 55 393 488 728 619 406 235 285 343 134 642 71 ...
result:
ok ok, up to 1201 steps were used
Test #28:
score: 0
Accepted
time: 10ms
memory: 19620kb
input:
1 998 494 391 49 950 498 165 692 300 510 673 931 837 954 352 465 197 719 959 328 896 303 198 461 729 298 887 437 549 445 696 457 955 378 552 765 73 180 383 103 980 321 852 194 345 105 513 471 538 3 527 878 708 732 148 913 833 806 894 111 897 816 790 828 947 858 604 388 142 517 455 367 632 36 240 396...
output:
1305 123 9 363 49 246 663 106 649 558 647 922 939 104 546 25 90 114 448 898 311 409 547 942 799 197 295 56 141 524 22 806 276 5 648 532 489 343 130 535 263 637 302 34 68 958 553 566 355 691 599 18 659 153 481 486 699 683 217 315 273 265 91 827 788 597 420 356 550 133 103 518 557 175 248 171 655 310 ...
result:
ok ok, up to 1305 steps were used
Test #29:
score: 0
Accepted
time: 29ms
memory: 21148kb
input:
1 998 765 850 400 698 96 680 434 963 388 616 398 505 511 25 611 887 550 641 153 736 743 946 908 659 14 595 984 939 332 937 373 792 787 251 150 617 767 809 990 477 959 953 380 358 789 462 987 348 227 929 931 168 510 452 823 387 627 614 62 466 529 59 449 410 711 758 649 158 541 403 531 475 968 795 412...
output:
1971 4 974 196 357 86 3 281 851 267 4 817 535 8 575 5 492 41 10 196 267 5 817 30 698 851 575 6 853 33 35 8 196 267 7 386 817 133 41 251 851 575 6 474 853 30 8 196 267 7 309 386 817 33 41 851 575 7 60 474 853 30 8 196 267 7 284 309 386 817 41 851 575 7 60 474 853 271 8 196 267 7 309 386 8...
result:
ok ok, up to 1971 steps were used
Test #30:
score: 0
Accepted
time: 55ms
memory: 26880kb
input:
1 998 627 431 727 497 487 126 684 838 644 15 516 818 127 44 10 657 823 189 63 115 939 963 873 607 346 706 608 79 210 461 392 243 454 227 647 565 774 851 478 625 141 910 177 14 239 317 498 543 457 294 893 531 132 234 492 804 92 585 908 116 678 674 19 583 856 403 595 688 554 797 223 596 789 295 438 24...
output:
2416 9 973 512 682 591 282 993 678 197 450 8 139 312 690 736 542 742 334 740 9 521 721 94 790 471 432 100 460 450 10 725 482 55 791 50 78 916 117 829 740 10 446 671 107 590 252 617 47 413 303 450 11 151 30 25 630 72 50 145 969 677 263 740 11 131 988 997 243 252 665 839 230 733 460 450 11 924 ...
result:
ok ok, up to 2416 steps were used
Test #31:
score: 0
Accepted
time: 59ms
memory: 28916kb
input:
1 998 733 959 347 569 526 485 632 134 887 320 369 825 92 463 536 915 808 805 589 982 537 826 812 336 647 686 638 884 36 841 243 429 687 855 483 29 293 140 892 280 94 750 682 816 394 791 676 186 913 339 766 945 655 960 718 480 866 974 85 121 849 188 206 933 604 517 820 553 476 313 370 420 964 193 528...
output:
1988 7 964 531 332 450 141 511 640 8 525 803 566 898 451 822 378 922 9 251 416 290 203 605 586 901 469 640 10 146 82 618 514 898 494 676 485 25 922 11 161 258 198 332 203 302 7 984 503 469 640 12 32 564 195 566 514 898 919 153 375 930 25 922 13 399 284 313 290 332 203 603 37 51 925 503 469 640...
result:
ok ok, up to 1988 steps were used
Test #32:
score: 0
Accepted
time: 9ms
memory: 18520kb
input:
1 998 238 368 91 13 760 72 419 694 981 177 883 447 4 329 902 810 141 624 473 919 916 507 778 923 701 863 657 812 200 832 256 605 472 974 301 328 515 304 481 62 176 297 891 345 661 769 889 595 488 422 849 276 954 644 897 708 960 333 236 240 326 40 485 564 782 896 79 197 187 869 136 6 830 828 60 788 4...
output:
1107 6 6 47 102 262 568 596 2 8 264 2 104 7 2 156 413 2 116 756 2 14 986 2 35 127 2 24 596 2 10 413 3 128 191 198 2 12 372 2 5 198 2 25 413 2 163 914 1 413 2 178 304 2 26 298 2 176 596 2 10 230 2 202 596 2 10 157 3 11 209 953 2 44 198 2 59 756 2 15 413 2 224 194 2 1 372 2 ...
result:
ok ok, up to 1107 steps were used
Test #33:
score: 0
Accepted
time: 4ms
memory: 18892kb
input:
1 998 657 220 904 795 418 211 522 176 489 271 647 237 700 935 594 194 535 136 835 286 259 838 858 551 906 623 502 154 508 141 742 797 863 682 500 920 299 899 850 642 68 495 689 282 656 735 745 796 181 593 894 929 783 723 713 414 260 314 354 668 563 193 727 768 845 996 625 41 376 296 983 235 677 840 ...
output:
1131 2 28 489 2 807 212 2 78 442 2 6 368 2 165 770 2 49 442 2 13 672 2 1 866 2 329 561 2 123 143 2 57 716 1 143 2 60 788 1 143 2 110 138 2 19 442 2 40 38 2 5 143 2 153 262 2 20 368 2 276 132 1 368 2 339 243 1 368 2 344 442 2 46 672 2 2 38 2 11 770 2 54 38 2 45 262 2 32 ...
result:
ok ok, up to 1131 steps were used
Test #34:
score: 0
Accepted
time: 10ms
memory: 15980kb
input:
1 998 571 670 211 487 704 982 672 742 89 547 852 953 925 808 256 92 828 807 288 236 815 570 430 408 434 407 426 447 763 310 694 720 706 870 36 35 61 622 479 791 46 208 944 933 389 41 417 514 504 712 106 543 343 143 992 134 793 891 613 630 37 234 616 93 589 887 212 544 345 477 945 113 866 278 853 814...
output:
1476 2 4 873 1 87 1 241 1 1 1 480 1 1 1 2 1 200 1 2 1 3 1 132 1 3 1 5 1 105 1 5 1 6 1 679 1 6 1 7 1 185 2 13 123 1 185 2 14 69 1 185 2 19 203 1 185 2 21 534 1 185 2 22 545 1 185 2 38 995 1 185 2 44 161 1 185 2 54 137 1 185 2 56 635 1 185 2 60 492 1 185 2 71 52...
result:
ok ok, up to 1476 steps were used
Test #35:
score: 0
Accepted
time: 10ms
memory: 15856kb
input:
1 998 648 130 748 548 766 651 270 645 672 196 25 141 588 538 622 530 658 580 763 359 794 476 341 579 11 614 893 255 703 612 569 290 232 446 393 323 535 371 821 870 281 157 518 148 325 619 986 138 434 807 923 626 714 250 239 209 620 309 945 829 347 360 118 173 367 693 571 957 599 568 725 973 488 936 ...
output:
1488 1 67 1 510 1 46 1 1 1 763 1 1 1 2 1 643 1 2 1 3 1 237 1 3 1 4 1 449 1 4 1 5 1 614 1 5 1 6 1 809 1 6 1 7 1 117 1 7 1 8 1 118 1 8 1 9 1 314 1 9 1 10 1 292 1 10 1 11 1 432 1 11 1 12 1 259 1 12 1 13 1 485 1 13 1 14 1 887 1 14 1 15 1 499 1 15 1 16 1 7...
result:
ok ok, up to 1488 steps were used
Test #36:
score: 0
Accepted
time: 2ms
memory: 8636kb
input:
1 1 1
output:
0
result:
ok ok, up to 0 steps were used
Test #37:
score: 0
Accepted
time: 22ms
memory: 8940kb
input:
400 48 43 47 8 20 36 13 35 3 23 34 15 48 6 31 11 44 27 33 37 4 46 40 9 28 29 41 17 24 25 32 14 30 18 10 7 5 19 45 42 22 26 39 1 16 38 21 2 12 10 29 29 17 13 3 42 26 5 26 37 41 6 40 16 19 12 26 38 23 7 39 11 33 10 39 43 39 20 10 35 18 45 14 5 21 34 6 38 39 8 45 26 25 9 12 33 15 37 9 45 3 48 1 47 21 3...
output:
52 10 4 41 3 24 13 47 33 36 27 29 5 5 11 7 1 43 4 9 13 34 31 5 23 26 20 36 43 6 39 17 10 1 34 18 5 8 5 13 36 43 5 9 20 1 34 18 5 23 5 13 36 43 6 39 9 45 1 34 29 6 42 23 16 13 36 18 4 39 5 1 43 4 9 15 34 31 4 23 26 36 43 4 40 1 34 18 4 5 35 36 43 5 9 33 1 34 18 5 23 5 35 36 43 4 9 1 ...
result:
ok ok, up to 126 steps were used
Test #38:
score: 0
Accepted
time: 16ms
memory: 18492kb
input:
3 1 1 986 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929 928 927 926 925 924 923 922 921 920 919 918 917 916 915 91...
output:
0 1787 1 1 2 610 2 2 611 1 3 612 610 2 4 613 611 3 1 4 614 612 4 2 5 615 613 5 3 1 6 616 614 610 6 4 2 6 617 615 611 7 5 1 7 618 616 612 610 8 6 2 8 619 617 613 611 9 7 3 1 8 620 618 614 612 10 8 4 2 9 621 619 615 613 11 9 5 3 1 9 620 616 614 610 12 10 6 4 2 8 617 615 611 13 11 7 5 1 ...
result:
ok ok, up to 1787 steps were used
Test #39:
score: 0
Accepted
time: 12ms
memory: 19012kb
input:
3 1 1 986 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929 928 927 926 925 924 923 922 921 920 919 918 917 916 915 91...
output:
0 1789 1 1 2 610 2 2 611 1 3 612 610 2 4 613 611 3 1 4 614 612 4 2 5 615 613 5 3 1 6 616 614 610 6 4 2 6 617 615 611 7 5 1 7 618 616 612 610 8 6 2 8 619 617 613 611 9 7 3 1 8 620 618 614 612 10 8 4 2 9 621 619 615 613 11 9 5 3 1 9 620 616 614 610 12 10 6 4 2 8 617 615 611 13 11 7 5 1 ...
result:
ok ok, up to 1789 steps were used
Test #40:
score: 0
Accepted
time: 14ms
memory: 19492kb
input:
3 1 1 986 973 974 972 975 970 971 976 967 968 966 969 977 962 963 961 964 959 960 965 978 954 955 953 956 951 952 957 948 949 947 950 958 979 941 942 940 943 938 939 944 935 936 934 937 945 930 931 929 932 927 928 933 946 980 920 921 919 922 917 918 923 914 915 913 916 924 909 910 908 911 906 907 91...
output:
0 1413 2 610 2 2 611 1 3 612 610 2 4 613 611 3 1 5 614 612 610 4 2 6 615 613 611 5 3 1 7 616 614 612 610 6 4 2 8 617 615 613 611 7 5 3 1 9 618 616 614 612 610 8 6 4 2 10 619 617 615 613 611 9 7 5 3 1 11 620 618 616 614 612 610 10 8 6 4 2 12 621 619 617 615 613 611 11 9 7 5 3 1 12 620 618...
result:
ok ok, up to 1413 steps were used
Test #41:
score: 0
Accepted
time: 12ms
memory: 18980kb
input:
3 1 1 986 986 985 983 984 981 980 982 978 977 975 976 979 973 972 970 971 968 967 969 974 965 964 962 963 960 959 961 957 956 954 955 958 966 952 951 949 950 947 946 948 944 943 941 942 945 939 938 936 937 934 933 935 940 953 931 930 928 929 926 925 927 923 922 920 921 924 918 917 915 916 913 912 91...
output:
0 1782 1 1 2 610 2 2 611 1 3 612 610 2 4 613 611 3 1 4 614 612 4 2 5 615 613 5 3 1 6 616 614 610 6 4 2 6 617 615 611 7 5 1 7 618 616 612 610 8 6 2 8 619 617 613 611 9 7 3 1 8 620 618 614 612 10 8 4 2 9 621 619 615 613 11 9 5 3 1 9 620 616 614 610 12 10 6 4 2 8 617 615 611 13 11 7 5 1 ...
result:
ok ok, up to 1782 steps were used
Test #42:
score: 0
Accepted
time: 5ms
memory: 18772kb
input:
3 1 1 986 2 1 7 3 6 5 4 20 8 11 10 9 19 13 12 18 14 17 16 15 54 21 24 23 22 32 26 25 31 27 30 29 28 53 34 33 39 35 38 37 36 52 40 43 42 41 51 45 44 50 46 49 48 47 143 55 58 57 56 66 60 59 65 61 64 63 62 87 68 67 73 69 72 71 70 86 74 77 76 75 85 79 78 84 80 83 82 81 142 89 88 94 90 93 92 91 107 95 98...
output:
0 102 3 609 376 1 4 606 377 371 1 4 598 376 358 1 4 577 371 324 1 4 522 358 235 1 2 324 2 2 378 235 1 1 1 2 0 11 520 378 465 842 753 611 232 143 144 145 3 14 521 515 466 464 379 839 754 748 611 233 231 146 140 3 14 520 502 465 456 379 831 753 735 611 232 223 141 127 3 14 515 464 435 379...
result:
ok ok, up to 102 steps were used
Test #43:
score: 0
Accepted
time: 12ms
memory: 16372kb
input:
3 1 1 986 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929 928 927 926 925 924 923 922 921 920 919 918 917 916 915 91...
output:
0 1760 2 388 1 2 387 2 3 386 3 1 4 385 610 4 2 4 384 611 5 1 5 383 612 610 6 2 6 382 613 611 7 3 1 6 381 614 612 8 4 2 7 380 615 613 9 5 3 1 8 379 616 614 610 10 6 4 2 7 617 615 611 11 7 5 1 8 618 616 612 610 12 8 6 2 9 378 619 617 613 611 13 9 7 3 8 620 618 614 612 10 8 4 1 9 621 619 ...
result:
ok ok, up to 1760 steps were used
Test #44:
score: 0
Accepted
time: 9ms
memory: 18696kb
input:
3 1 1 986 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929 928 927 926 925 924 923 922 921 920 919 918 917 916 915 91...
output:
0 1426 4 608 609 610 2 3 606 611 1 5 607 598 612 610 2 6 606 577 613 611 3 1 7 598 522 614 612 610 4 2 7 577 615 613 611 5 3 1 7 616 614 612 610 6 4 2 8 617 615 613 611 7 5 3 1 9 618 616 614 612 610 8 6 4 2 10 619 617 615 613 611 9 7 5 3 1 11 620 618 616 614 612 610 10 8 6 4 2 12 621 619 ...
result:
ok ok, up to 1426 steps were used
Test #45:
score: 0
Accepted
time: 3ms
memory: 18336kb
input:
1 1000 996 43 577 950 687 195 887 640 567 684 142 595 290 471 322 5 885 318 272 246 98 607 931 578 718 867 45 676 655 616 650 222 367 615 31 385 203 834 488 437 710 603 804 392 713 399 311 70 847 617 513 411 575 695 347 431 463 216 77 306 295 144 566 475 270 933 897 892 706 954 526 440 240 919 974 7...
output:
667 334 886 863 32 341 712 26 246 895 53 345 516 941 153 618 463 766 121 467 135 541 737 227 216 955 694 819 65 13 278 141 442 588 985 499 791 200 441 509 462 1 136 765 816 92 779 682 515 389 296 698 714 750 337 69 806 747 275 981 402 255 931 224 728 822 143 348 631 794 843 446 440 448 110 833 906 2...
result:
ok ok, up to 667 steps were used
Test #46:
score: 0
Accepted
time: 3ms
memory: 18080kb
input:
1 1000 107 95 790 410 138 13 486 51 36 3 226 569 961 785 273 822 628 927 699 802 255 856 441 499 246 751 534 187 257 935 505 562 575 217 567 767 351 315 178 476 532 144 182 111 511 112 479 830 70 834 551 266 69 636 501 541 128 504 125 708 278 969 97 872 52 945 538 949 784 821 341 168 232 988 154 437...
output:
667 1 331 1 810 1 405 1 305 1 937 1 481 1 128 1 876 1 631 1 484 1 7 1 697 1 68 1 320 1 191 1 130 1 630 1 136 1 341 1 888 1 997 1 408 1 467 1 705 1 856 1 401 1 113 1 513 1 32 1 605 1 747 1 757 1 830 1 882 1 529 1 886 1 925 1 364 1 488 1 815 1 87 1 976 1 939 ...
result:
ok ok, up to 667 steps were used
Test #47:
score: 0
Accepted
time: 3ms
memory: 16604kb
input:
1 1000 657 131 1 655 428 7 948 767 429 296 26 667 74 3 804 399 782 796 260 295 719 724 378 56 708 570 442 500 896 403 861 937 833 616 379 812 95 457 122 293 210 917 162 342 22 189 963 949 14 766 933 847 199 117 911 612 424 274 791 6 671 715 805 564 718 542 928 416 11 314 315 891 494 906 120 829 173 ...
output:
667 1 121 1 694 1 287 1 878 1 265 1 431 1 212 1 338 1 310 1 242 1 689 1 31 1 617 1 401 1 912 1 572 1 928 1 107 1 776 1 260 1 593 1 790 1 650 1 942 1 910 1 227 1 142 1 981 1 554 1 702 1 875 1 504 1 967 1 759 1 676 1 98 1 153 1 503 1 432 1 126 1 247 1 711 1 94...
result:
ok ok, up to 667 steps were used
Test #48:
score: 0
Accepted
time: 0ms
memory: 18732kb
input:
1 1000 291 378 38 938 62 810 402 752 333 22 916 737 852 709 865 667 686 954 716 419 876 191 853 829 841 904 296 471 387 151 823 167 7 455 509 719 325 4 893 235 570 204 206 196 911 16 366 638 303 903 885 414 948 102 715 50 334 593 444 774 635 819 362 990 642 730 541 65 901 493 271 377 857 170 586 252...
output:
667 334 194 862 303 286 924 402 270 725 44 209 910 361 780 833 264 32 702 830 817 629 534 175 104 400 195 682 314 521 654 642 757 417 951 649 326 113 430 867 957 82 225 105 357 715 485 61 232 630 716 754 539 440 260 340 25 358 372 639 333 518 227 123 962 87 905 551 766 895 972 21 287 676 88 394 644 ...
result:
ok ok, up to 667 steps were used
Extra Test:
score: -3
Extra Test Failed : Runtime Error on 2
input:
1 2 2 1 1 2