QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#549320 | #83. Jumping Grasshopper | hhy0613 | AC ✓ | 133ms | 25604kb | C++14 | 2.6kb | 2024-09-06 14:20:58 | 2024-09-06 14:20:58 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1000005,INF=0x3f3f3f3f;
int a[N];
struct node{
node *left,*right,*dad;
int mx,l,r;
}pool[N<<2],*root=nullptr,*ma[N];
int cnt;
node* New(node* fa,int x,int l,int r){
pool[cnt]=node{nullptr,nullptr,fa,x,l,r};
return pool+(cnt++);
}
void sol(node* p){p->mx=max(p->left->mx,p->right->mx);}
node* build(int l,int r,node* fa){
if(l+1==r) return (ma[l]=New(fa,a[l],l,r));
int mid=l+(r-l)/2;
node* p=New(fa,0,l,r);
p->left=build(l,mid,p);
p->right=build(mid,r,p);
sol(p);
return p;
}
void update(node* p,int l,int r,int pos,int x){
if(l+1==r){
p->mx=x;
return;
}
int mid=l+(r-l)/2;
if(pos<mid) update(p->left,l,mid,pos,x);
else update(p->right,mid,r,pos,x);
sol(p);
}
int query(node* p,int L,int R,int l,int r){
if(l>=r) return -INF;
if(l<=L && R<=r) return p->mx;
int mid=L+(R-L)/2,ans=-INF;
if(l<mid) ans=max(ans,query(p->left,L,mid,l,r));
if(r>mid) ans=max(ans,query(p->right,mid,R,l,r));
return ans;
}
int searchpre(node* p,int l,int r,int x){
if(l+1==r) return l;
int mid=l+(r-l)/2;
if(p->right->mx>x) return searchpre(p->right,mid,r,x);
return searchpre(p->left,l,mid,x);
}
int findpre(int pos,int x){
node* p=ma[pos];
while(p!=root){
if(p==p->dad->right){
node* r=p->dad->left;
if(r->mx>x) return searchpre(r,r->l,r->r,x);
}
p=p->dad;
}
return -1;
}
int searchnxt(node* p,int l,int r,int x){
if(l+1==r) return l;
int mid=l+(r-l)/2;
if(p->left->mx>x) return searchnxt(p->left,l,mid,x);
return searchnxt(p->right,mid,r,x);
}
int findnxt(int pos,int x){
node* p=ma[pos];
while(p!=root){
if(p==p->dad->left){
node* r=p->dad->right;
if(r->mx>x) return searchnxt(r,r->l,r->r,x);
}
p=p->dad;
}
return -1;
}
int main(){
ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
int n,q;
cin >> n >> q;
for(int i=0;i<n;++i) cin >> a[i];
root=build(0,n,nullptr);
while(q--){
char op;
cin >> op;
if(op=='U'){
int pos,val;
cin >> pos >> val;
--pos;
a[pos]=val;
update(root,0,n,pos,val);
}else{
int x;
char d=op;
cin >> x;
--x;
if(d=='L'){
const int lmx=query(root,0,n,0,x),rmx=query(root,0,n,x+1,n);
if(lmx<a[x]) cout << x+1 << '\n';
else if(lmx>rmx) cout << findpre(x,max(a[x],rmx))+1 << '\n';
else cout << findnxt(x,lmx)+1 << '\n';
}else{
const int lmx=query(root,0,n,0,x),rmx=query(root,0,n,x+1,n);
if(rmx<a[x]) cout << x+1 << '\n';
else if(lmx<rmx) cout << findnxt(x,max(a[x],lmx))+1 << '\n';
else cout << findpre(x,rmx)+1 << '\n';
}
}
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 7780kb
input:
10 4 1 8 5 6 10 20 12 15 2 4 L 2 R 3 U 10 16 L 9
output:
2 5 6
result:
ok 3 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 7780kb
input:
1 5 459286520 L 1 U 1 772746366 U 1 928843666 R 1 U 1 937054519
output:
1 1
result:
ok 2 lines
Test #3:
score: 0
Accepted
time: 1ms
memory: 7648kb
input:
5 10 593533243 631485066 519299283 682090771 538860279 U 5 817141245 U 1 959331749 U 4 923872363 R 2 U 5 870220838 R 4 U 1 980405239 L 3 R 2 R 2
output:
1 4 1 1 1
result:
ok 5 lines
Test #4:
score: 0
Accepted
time: 1ms
memory: 7704kb
input:
10 50 350437702 476552988 598507862 42315934 326664970 957733029 128609487 678642866 623924231 900170898 R 8 U 8 707297133 L 2 U 7 196489199 U 6 961888418 L 3 R 4 R 9 R 8 U 4 718445226 U 4 774977932 R 8 U 8 716604413 L 8 U 1 356609473 U 3 881452560 L 9 U 5 877197879 L 9 U 7 227861500 U 1 561052511 U...
output:
6 2 3 6 6 6 6 6 6 6 6 4 4 6 1 1 3 10 6 6 4
result:
ok 21 lines
Test #5:
score: 0
Accepted
time: 1ms
memory: 7776kb
input:
50 100 261734700 853221346 617427680 133608005 941856159 750722631 795428196 707149957 573700530 457178265 180028824 841168514 104059208 773139650 495325699 367786314 637124094 941080954 206563426 9329053 326119545 377780890 278174528 108260301 926568063 12091207 524435672 552272902 706001180 510050...
output:
5 31 47 5 31 31 40 31 25 40 40 47 35 25 25 40 42 25 25 14 25 14 25 6 25 40 25 14 47 43 42 14 25 34 25 25 34 40 14 14 25 14
result:
ok 42 lines
Test #6:
score: 0
Accepted
time: 0ms
memory: 7708kb
input:
100 100 415759120 382409553 725318900 430945827 100485382 873651038 287797335 720078062 869311948 837592661 227692167 255146735 717373268 510914589 567974115 21604327 424161249 926295297 617275348 401906702 186388478 230350848 566333564 430550034 765438882 733962527 454106874 796435443 11343796 3860...
output:
66 55 55 55 55 84 55 94 55 66 55 55 55 55 79 55 6 55 79 55 55 66 91 55 55 6 3 66 55 55 1 71 79 87 55 3 91 55 55 55 71 87 66 66 66 66 66 6 66 66 66 71 66 66 71 71 66 66
result:
ok 58 lines
Test #7:
score: 0
Accepted
time: 0ms
memory: 7736kb
input:
100 500 559299102 788935850 9430119 299294666 148138178 513505747 888660236 431153716 671992 729199726 436104923 575226174 520502177 838611746 370697114 49472109 192006370 803823943 254173634 315859407 510318225 940938503 174016432 813211485 814978247 367291077 333432843 509285935 420266828 80501924...
output:
85 85 54 89 85 54 95 85 85 100 85 85 18 85 85 18 85 85 85 85 85 87 85 85 85 85 85 85 85 7 85 95 18 7 85 85 7 85 89 85 54 85 54 54 54 54 95 54 54 54 54 87 54 60 54 54 54 60 54 59 60 95 37 54 60 60 54 37 59 54 54 18 60 59 100 54 60 54 54 8 8 63 54 59 87 73 59 58 54 54 2 63 18 95 54 100 59 37 59 37 59 ...
result:
ok 258 lines
Test #8:
score: 0
Accepted
time: 1ms
memory: 7804kb
input:
100 1000 349825829 548284219 712290730 878791192 201545249 414659503 562602788 980684601 246143817 424012335 447246393 712923213 35447176 665989894 442507539 298440967 146564718 838313427 91667513 445972240 618105243 500903829 837907455 187739554 910119512 920633592 564869666 838531522 566154288 819...
output:
8 8 8 96 8 8 8 82 71 48 8 71 8 71 71 3 71 82 48 71 71 48 8 91 50 71 48 82 82 50 82 48 48 82 48 48 48 8 50 48 48 82 50 30 96 71 48 50 1 30 30 48 48 89 50 8 96 48 50 71 100 96 34 50 71 34 50 50 71 34 34 71 71 91 34 71 34 3 71 71 71 34 71 34 71 71 34 71 71 71 71 34 34 71 71 71 34 34 34 71 71 71 71 71 7...
result:
ok 479 lines
Test #9:
score: 0
Accepted
time: 3ms
memory: 7752kb
input:
1000 10000 680605982 761436876 599956119 919897707 268088668 177341135 441716959 14021051 312918092 203085728 193751713 434030999 540669067 841929697 895817640 357168000 857311250 279052013 93584920 703886783 421646044 852977224 113424840 626811409 299589587 546819164 436181576 873595744 143738500 5...
output:
320 191 953 911 191 647 654 647 647 654 647 911 990 191 320 654 320 647 990 647 990 647 647 647 911 647 654 647 647 654 999 647 320 57 911 647 654 654 911 647 191 647 647 647 647 320 647 953 654 647 191 191 654 320 647 654 647 647 647 654 320 647 191 647 647 647 911 654 125 911 125 647 647 125 647 6...
result:
ok 5049 lines
Test #10:
score: 0
Accepted
time: 4ms
memory: 7788kb
input:
10000 20000 464026448 962229611 417613302 494867811 647902756 616398444 30360520 220373841 327554418 558043170 716193041 512071583 922582283 364507385 223235899 580920450 659056249 846308898 308669710 742046739 932599070 395237599 628148945 204030314 794307506 335109894 999505040 251572555 862279915...
output:
5659 2288 5659 9744 5659 5659 5659 2288 506 506 5659 5659 2288 5659 5659 506 2288 5659 8461 8461 5659 2288 5659 5659 2288 5659 2288 5659 5659 5659 2288 5659 5659 5659 2288 5659 5659 2288 8461 8461 5659 5659 5659 8461 2288 5659 9664 2288 2288 506 2288 5659 5659 2288 5659 7022 2288 8461 5659 7022 5659...
result:
ok 9815 lines
Test #11:
score: 0
Accepted
time: 16ms
memory: 9860kb
input:
20000 40000 18426001 167196273 5380967 8567463 459706382 156844390 594089561 29638398 127629487 974887560 576565640 517659354 61959065 970572987 376385532 989577658 570546644 419372997 656593984 356989423 250085941 692229552 324790774 281029985 785946809 550206561 813630958 694613510 173776856 73165...
output:
4889 4889 4889 4889 4889 4889 4889 4889 2053 19132 4889 4889 4889 4889 4889 2610 4889 4889 4889 4889 4889 4889 4889 4889 4889 4889 4889 4889 4889 4246 4889 4889 4889 4246 4889 4889 4889 4889 4889 4889 2053 2053 19238 4889 4889 4246 2610 4889 4889 4889 4889 4889 4889 2053 4889 4889 4889 4889 4889 488...
result:
ok 19985 lines
Test #12:
score: 0
Accepted
time: 5ms
memory: 7864kb
input:
9999 19998 0 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...
output:
5000 4999 5001 4998 5002 4997 5003 4996 5004 4995 5005 4994 5006 4993 5007 4992 5008 4991 5009 4990 5010 4989 5011 4988 5012 4987 5013 4986 5014 4985 5015 4984 5016 4983 5017 4982 5018 4981 5019 4980 5020 4979 5021 4978 5022 4977 5023 4976 5024 4975 5025 4974 5026 4973 5027 4972 5028 4971 5029 4970 ...
result:
ok 9999 lines
Test #13:
score: 0
Accepted
time: 22ms
memory: 9960kb
input:
30000 60000 276963286 306684789 540557510 289523136 975579593 564413393 30524823 941373584 398462334 730876928 21476450 277506484 223277284 723106202 432870547 631136212 430582761 492844982 365403001 377318586 878289960 18044837 500533805 444743530 530770636 634227014 638205564 873394164 142548892 7...
output:
18139 18139 18139 8452 8452 18139 21082 21082 21082 6260 18139 8452 551 6260 9044 1094 6260 18139 18139 18139 21082 21082 6260 8452 21082 21082 6260 18139 18139 8452 1119 21082 8452 6260 6260 8452 6260 18139 18139 18139 21082 18139 21082 21082 21082 18139 1094 6260 21082 21082 18139 18139 6260 18139...
result:
ok 29826 lines
Test #14:
score: 0
Accepted
time: 30ms
memory: 12136kb
input:
40000 80000 51965849 353109108 364845474 368651771 965530905 865226040 7218837 667679689 719726084 96525961 33582385 799966597 733777046 525100145 506791787 867537550 104107284 678736157 380433477 935709272 248179383 627618597 875661786 933744050 497982621 526693688 162477237 245942084 476336867 642...
output:
7338 24723 24723 24723 33529 7338 35823 7338 24723 33529 24723 24723 30445 7338 24723 35823 7338 7338 37917 24723 7338 24723 30445 24723 24723 24723 39662 24723 7338 7338 7338 35823 24723 24723 24723 30445 24723 24723 37917 30445 30445 7338 35823 24723 30445 24723 24723 39759 24723 37917 30445 24723...
result:
ok 39707 lines
Test #15:
score: 0
Accepted
time: 25ms
memory: 12232kb
input:
50000 80000 138678577 91873246 100094097 186410185 371592683 144353330 497240414 549211736 140509846 400330900 41489713 950555870 960012662 286550271 968665484 18239177 375690337 157368080 470753128 612989477 746969941 592029580 635276970 404428490 958710788 874903231 506016534 537247727 21276693 98...
output:
47319 47319 42476 42476 30650 30650 30650 30650 30650 42476 45790 30650 42476 30650 30650 30650 30650 30650 30650 42476 30650 30650 30650 30650 30650 30650 30650 42476 30650 30650 30650 30650 30650 42476 30650 30650 42476 30650 42476 47319 42476 30650 42476 30650 30650 30650 42476 42476 30650 45790 ...
result:
ok 39884 lines
Test #16:
score: 0
Accepted
time: 39ms
memory: 14320kb
input:
60000 80000 183581161 93054252 664119809 318364742 666424035 934874561 515864993 36936144 365219203 660673045 673865026 200098115 239460707 509862942 907165640 629783823 992188269 826084267 228537126 852320767 913153493 846574629 414882648 919365479 613659961 909766362 732755578 252608056 867973918 ...
output:
49621 49621 49621 49621 49621 59612 49621 49621 49996 49621 49996 13290 13290 13290 49621 13290 49996 49996 13290 49621 49621 13290 768 49621 13290 49621 49621 13290 49996 49996 3714 3714 18374 49621 49996 49996 49996 13290 49996 49996 49621 49996 49621 49996 59612 598 49621 49621 3714 49621 13290 4...
result:
ok 40041 lines
Test #17:
score: 0
Accepted
time: 38ms
memory: 12416kb
input:
70000 90000 13064565 921461243 71172321 540354556 64258072 580690529 300139441 932350846 936196822 43420193 670645379 264836708 167919902 819938442 162976769 930299879 450443669 642032456 511318124 423107670 229063064 996861412 601446522 454727576 510032875 353842714 812861109 365642523 573142974 68...
output:
7655 67177 67177 67177 7655 67177 67177 67177 67177 67177 7655 67177 67177 67177 67177 69859 67177 67177 67177 67177 67177 67177 67177 67177 67177 67177 67177 68809 67177 67177 67177 67177 67177 7655 67177 67177 7655 67177 67177 67177 67177 67177 67177 67177 67177 67177 67177 67177 67177 67177 7655 ...
result:
ok 44893 lines
Test #18:
score: 0
Accepted
time: 42ms
memory: 15872kb
input:
80000 90000 301973931 146464432 290275573 753434996 973683043 28406125 466065350 3124521 746700608 88004164 978142670 535499113 483544871 587870148 961570273 857524003 798034576 447195343 366222890 611360554 848706070 303746649 342636675 204937062 211051566 656365850 214663528 803713437 305754389 41...
output:
77694 46556 46556 9589 46556 46556 59140 46556 46556 5676 46556 59140 46556 59140 46556 46556 46556 46556 59140 46556 59140 46556 46556 46556 46556 46556 9589 46556 46556 46556 46556 5676 5676 59140 46556 46556 46556 46556 46556 59140 46556 59140 46556 46556 46556 46556 46556 59140 46556 59140 46556...
result:
ok 45046 lines
Test #19:
score: 0
Accepted
time: 55ms
memory: 14648kb
input:
90000 100000 826629317 13818030 589969548 733958204 976758060 826531774 476837228 435420786 695607570 672461559 219979270 125663908 854174603 343517857 850633462 490443495 790991045 880222029 398176085 818751627 810666525 719110781 442244159 388728629 612524630 715898041 887750800 568609744 26055946...
output:
38802 68386 68386 68386 68386 38802 6319 38802 68386 68386 6319 68386 68386 68386 38802 68386 68386 68386 68386 38802 68386 68386 68386 38802 68386 68386 68386 68386 68386 38802 6319 68386 68386 68386 68386 89173 68386 68386 68386 38802 68386 11074 68386 6319 11074 68386 86052 68386 38802 68386 3880...
result:
ok 50086 lines
Test #20:
score: 0
Accepted
time: 92ms
memory: 16628kb
input:
100000 200000 67579687 226138329 177132043 344498526 269901420 904647846 308949588 610431011 128691889 907951421 888790562 187843937 501555432 34211586 238954235 872470092 765878926 373125933 983000106 270822890 878136488 107066266 455657172 378771396 926581397 208522475 457543427 356632654 84414351...
output:
38947 66170 38947 66170 66170 66170 82583 38947 71695 66170 38947 71695 82583 66170 97563 44226 38947 82583 38947 82583 38947 99505 38947 71695 38947 71695 38947 66170 38947 71695 38947 38947 38947 71695 66170 71695 97563 66170 66170 38947 38947 38947 66170 38947 38947 97563 66170 38947 44226 38947 ...
result:
ok 99992 lines
Test #21:
score: 0
Accepted
time: 112ms
memory: 19064kb
input:
150000 200000 267431520 611703004 564431941 80434400 635305141 536232970 451194092 804342535 337446305 948726625 918270893 667238038 760829572 272200564 554943177 709262535 297483323 139512564 879994131 295553382 902882278 168532573 443496058 840291866 769325843 259129092 792778802 435185959 3933734...
output:
134304 39660 62392 799 134304 39660 28367 28367 39660 28367 66458 39660 28367 28367 66458 66458 66458 28367 39660 128984 66458 128984 66458 28367 28367 62392 62392 66458 128984 134304 62392 39660 62392 66458 28367 36006 134304 62392 66458 66458 28367 39660 66458 62392 66458 134304 128984 66458 66458...
result:
ok 100236 lines
Test #22:
score: 0
Accepted
time: 133ms
memory: 25604kb
input:
190000 200000 773256836 680486653 911413191 177580670 135329843 546781233 399834803 346075405 335838648 734998323 49836120 217471487 195024250 79661336 995132222 18563331 40869905 918051254 978244715 727627269 440781783 22243796 324622580 119206490 132078097 627109517 815412426 257791598 647108591 5...
output:
27362 146649 150393 146649 2239 146649 146649 27362 150393 146649 146649 146649 146649 150393 146649 146649 146649 146649 150393 146649 179047 146649 146649 150393 150393 179047 146649 146649 175568 146649 27362 146649 146649 27362 146649 150393 179047 146649 27362 146649 146649 146649 146649 146649...
result:
ok 100411 lines
Test #23:
score: 0
Accepted
time: 5ms
memory: 7788kb
input:
8783 17566 0 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...
output:
4392 4391 4393 4390 4394 4389 4395 4388 4396 4387 4397 4386 4398 4385 4399 4384 4400 4383 4401 4382 4402 4381 4403 4380 4404 4379 4405 4378 4406 4377 4407 4376 4408 4375 4409 4374 4410 4373 4411 4372 4412 4371 4413 4370 4414 4369 4415 4368 4416 4367 4417 4366 4418 4365 4419 4364 4420 4363 4421 4362 ...
result:
ok 8783 lines
Test #24:
score: 0
Accepted
time: 133ms
memory: 25244kb
input:
200000 200000 687927477 542472152 366031731 9474860 556367844 498084430 95356630 775739132 452498752 38119961 774038867 728840809 802242444 41570659 448049767 861757187 687376663 534418923 606408095 415070413 58883386 8767344 991501746 768717229 709760484 628257110 486201944 61739292 298487841 98247...
output:
62247 66462 66462 66462 31519 66462 66462 62247 66462 31519 66462 66462 31519 66462 31519 66462 66462 169901 66462 62247 197700 62247 66462 62247 66462 31519 62247 62247 151553 66462 62247 151553 66462 66462 62247 66462 66462 66462 66462 31519 66462 169901 66462 62247 31519 66462 189206 192879 16990...
result:
ok 100145 lines
Test #25:
score: 0
Accepted
time: 0ms
memory: 9708kb
input:
6461 12922 0 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...
output:
3231 3230 3232 3229 3233 3228 3234 3227 3235 3226 3236 3225 3237 3224 3238 3223 3239 3222 3240 3221 3241 3220 3242 3219 3243 3218 3244 3217 3245 3216 3246 3215 3247 3214 3248 3213 3249 3212 3250 3211 3251 3210 3252 3209 3253 3208 3254 3207 3255 3206 3256 3205 3257 3204 3258 3203 3259 3202 3260 3201 ...
result:
ok 6461 lines
Test #26:
score: 0
Accepted
time: 3ms
memory: 7716kb
input:
4999 9998 0 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 ...
output:
2500 2499 2501 2498 2502 2497 2503 2496 2504 2495 2505 2494 2506 2493 2507 2492 2508 2491 2509 2490 2510 2489 2511 2488 2512 2487 2513 2486 2514 2485 2515 2484 2516 2483 2517 2482 2518 2481 2519 2480 2520 2479 2521 2478 2522 2477 2523 2476 2524 2475 2525 2474 2526 2473 2527 2472 2528 2471 2529 2470 ...
result:
ok 4999 lines
Test #27:
score: 0
Accepted
time: 0ms
memory: 7816kb
input:
2001 4002 0 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 ...
output:
1001 1000 1002 999 1003 998 1004 997 1005 996 1006 995 1007 994 1008 993 1009 992 1010 991 1011 990 1012 989 1013 988 1014 987 1015 986 1016 985 1017 984 1018 983 1019 982 1020 981 1021 980 1022 979 1023 978 1024 977 1025 976 1026 975 1027 974 1028 973 1029 972 1030 971 1031 970 1032 969 1033 968 10...
result:
ok 2001 lines
Test #28:
score: 0
Accepted
time: 2ms
memory: 7744kb
input:
971 1942 0 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 1...
output:
486 485 487 484 488 483 489 482 490 481 491 480 492 479 493 478 494 477 495 476 496 475 497 474 498 473 499 472 500 471 501 470 502 469 503 468 504 467 505 466 506 465 507 464 508 463 509 462 510 461 511 460 512 459 513 458 514 457 515 456 516 455 517 454 518 453 519 452 520 451 521 450 522 449 523 ...
result:
ok 971 lines
Test #29:
score: 0
Accepted
time: 0ms
memory: 7796kb
input:
83 166 0 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 U 42 83 L 42 U 41 84 L 42 U 43 85 L 42 U 40 86 L 42 U ...
output:
42 41 43 40 44 39 45 38 46 37 47 36 48 35 49 34 50 33 51 32 52 31 53 30 54 29 55 28 56 27 57 26 58 25 59 24 60 23 61 22 62 21 63 20 64 19 65 18 66 17 67 16 68 15 69 14 70 13 71 12 72 11 73 10 74 9 75 8 76 7 77 6 78 5 79 4 80 3 81 2 82 1 83
result:
ok 83 lines
Test #30:
score: 0
Accepted
time: 1ms
memory: 7724kb
input:
7 14 0 1 2 3 4 5 6 U 4 7 L 4 U 3 8 L 4 U 5 9 L 4 U 2 10 L 4 U 6 11 L 4 U 1 12 L 4 U 7 13 L 4
output:
4 3 5 2 6 1 7
result:
ok 7 lines