QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#291816 | #3840. Pass the Ball! | ship2077 | AC ✓ | 148ms | 28736kb | C++14 | 2.1kb | 2023-12-27 08:49:02 | 2023-12-27 08:49:02 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
constexpr int M=1<<19,G=3,mod1=998244353,mod2=1004535809;
constexpr int G1=(mod1+1)/3,G2=(mod2+1)/3,inv=669690699;
typedef long long LL;
vector<int>e;bool vis[M],buc[M];
vector<LL>vec[M];LL ans;
int n,q,l,x,lim,p[M],rev[M];
int read(){
int x=0;char ch=getchar();
while (!isdigit(ch)) ch=getchar();
while (isdigit(ch)) x=x*10+ch-48,ch=getchar();
return x;
}
int rdc1(int x){return x>=mod1?x-mod1:x;}
int rdc2(int x){return x>=mod2?x-mod2:x;}
struct Int{ int x,y;
friend Int operator +(Int a,Int b){return (Int){rdc1(a.x+b.x),rdc2(a.y+b.y)};}
friend Int operator -(Int a,Int b){return (Int){rdc1(a.x+mod1-b.x),rdc2(a.y+mod2-b.y)};}
friend Int operator *(Int a,Int b){return (Int){1ll*a.x*b.x%mod1,1ll*a.y*b.y%mod2};}
LL ans(){return 1ll*(y-x+mod2)%mod2*inv%mod2*mod1+x;}
}a[M],b[M];
int qpow(int x,int n,int mod){
int s=1;while (n){
if (n&1) s=1ll*s*x%mod;
x=1ll*x*x%mod;n>>=1;
} return s;
}
void NTT(Int *a,int type){
for (int i=0;i<lim;i++)
if (rev[i]>i) swap(a[rev[i]],a[i]);
for (int i=1;i<lim;i<<=1){
Int Wn=(Int){qpow(type?G:G1,mod1/(i<<1),mod1),qpow(type?G:G2,mod2/(i<<1),mod2)};
for (int j=0;j<lim;j+=i<<1){ Int w=(Int){1,1};
for (int k=0;k<i;w=w*Wn,k++){
Int x=a[j+k],y=a[i+j+k]*w;
a[j+k]=x+y;a[i+j+k]=x-y;
}
}
}
}
void solve(int n){
for (int i=0;i<n;i++) b[i]=a[i+n]=a[i];
reverse(b,b+n);l=-1;lim=1;
while (lim<=n*3) lim<<=1,l++;
for (int i=0;i<lim;i++) rev[i]=rev[i>>1]>>1|(i&1)<<l;
NTT(a,1);NTT(b,1);
for (int i=0;i<lim;i++) a[i]=a[i]*b[i];
NTT(a,0);Int inv=(Int){qpow(lim,mod1-2,mod1),qpow(lim,mod2-2,mod2)};
for (int i=0;i<lim;i++) a[i]=a[i]*inv;
}
void clear(){for (int i=0;i<lim;i++) a[i]=b[i]=(Int){0,0};}
int main(){
n=read();q=read();
for (int i=1;i<=n;i++) p[i]=read();
for (int i=1;i<=n;i++)
if (!vis[i]){ int m=0;
for (int j=i;!vis[j];j=p[j]) a[m++]={j,j},vis[j]=1;solve(m);
if (!buc[m]) buc[m]=1,e.push_back(m),vec[m].resize(m);
for (int i=0;i<m;i++) vec[m][i]+=a[i+m-1].ans(); clear();
}
while (q--){
x=read();ans=0;
for (auto t:e)
ans+=vec[t][x%t];
printf("%lld\n",ans);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 24176kb
input:
4 4 2 4 1 3 1 2 3 4
output:
25 20 25 30
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 24280kb
input:
3 6 2 3 1 1 2 3 999999998 999999999 1000000000
output:
11 11 14 11 14 11
result:
ok 6 lines
Test #3:
score: 0
Accepted
time: 3ms
memory: 22504kb
input:
3 6 3 1 2 1 2 3 999999998 999999999 1000000000
output:
11 11 14 11 14 11
result:
ok 6 lines
Test #4:
score: 0
Accepted
time: 0ms
memory: 22412kb
input:
1000 10000 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...
output:
333334000 332835500 332338000 331841500 331346000 330851500 330358000 329865500 329374000 328883500 328394000 327905500 327418000 326931500 326446000 325961500 325478000 324995500 324514000 324033500 323554000 323075500 322598000 322121500 321646000 321171500 320698000 320225500 319754000 319283500 ...
result:
ok 10000 lines
Test #5:
score: 0
Accepted
time: 3ms
memory: 24236kb
input:
1000 10000 187 493 316 665 124 40 448 649 657 65 438 730 816 107 789 286 309 469 169 216 488 52 212 111 541 83 990 48 282 867 36 220 676 241 959 372 322 244 481 708 595 957 215 223 120 658 291 176 229 158 431 492 221 986 889 861 606 518 106 349 410 765 745 812 563 998 150 392 358 328 747 793 587 507...
output:
250347169 248662078 245260552 253150328 247096579 249698948 249942589 251180693 248589849 253775352 248472247 248369272 249001282 249611561 251718722 248202949 252492155 251442262 255269934 247070745 248898892 250071493 249262069 247714054 248954719 251676093 251650611 249152315 248608212 249678723 ...
result:
ok 10000 lines
Test #6:
score: 0
Accepted
time: 0ms
memory: 22308kb
input:
1000 10000 301 793 604 129 545 524 625 540 271 616 710 629 682 190 152 287 40 5 921 699 730 427 833 680 514 782 641 754 15 218 725 862 238 468 917 368 850 35 243 339 688 460 597 979 398 748 552 25 189 68 115 76 888 844 890 102 835 581 266 342 571 749 574 156 717 538 440 764 601 831 130 39 136 842 78...
output:
250889096 249771741 249454079 255348475 249559048 257117687 248782164 250050189 254433188 254774148 251601723 250597849 251570596 249861162 256368189 253409601 254026050 249568513 248807065 253946543 254531155 252620668 255570774 257943265 252823304 255566622 252678751 254417015 252540528 256854774 ...
result:
ok 10000 lines
Test #7:
score: 0
Accepted
time: 4ms
memory: 22820kb
input:
1000 10000 163 149 53 93 995 744 452 73 683 474 213 597 903 190 842 487 894 256 339 588 902 930 870 632 992 561 455 248 961 788 188 436 421 887 847 361 311 192 706 636 352 233 987 376 323 32 120 565 546 730 191 587 404 22 817 906 585 420 621 167 132 816 431 200 952 180 402 838 794 284 349 94 427 482...
output:
250865862 251948566 251553098 253385993 250129972 254017302 254493541 251442447 247937015 250833800 249523549 249193386 252059812 249370594 254109165 249397918 247138568 248934855 249807415 251196617 250357758 249395769 248148350 247009170 252163335 249850249 250639740 251827755 247795165 253868762 ...
result:
ok 10000 lines
Test #8:
score: 0
Accepted
time: 0ms
memory: 24312kb
input:
1000 10000 384 881 331 471 166 902 45 90 353 415 895 74 693 69 887 878 807 436 538 328 892 750 294 891 238 527 406 464 23 259 200 731 336 62 30 157 457 243 956 485 670 37 405 16 14 162 484 875 64 38 305 177 391 882 440 649 296 702 990 953 468 109 915 316 622 81 863 286 412 584 659 271 282 984 490 97...
output:
251829371 249579880 249800743 251369774 250567175 248916841 252235114 251856809 249117279 247474406 250612288 247256785 251394491 250004784 252462213 249291071 251938054 251833233 254868301 251496842 242701038 251189092 250051802 248910394 249438626 245833186 250955694 251605815 251188358 253696421 ...
result:
ok 10000 lines
Test #9:
score: 0
Accepted
time: 4ms
memory: 22580kb
input:
1000 10000 791 811 116 51 267 840 647 573 765 859 154 984 879 576 938 308 808 301 287 158 43 453 284 243 945 585 156 648 447 331 930 296 657 820 991 457 969 237 644 784 514 685 487 506 353 854 336 7 111 324 593 4 234 548 680 923 501 186 201 918 821 968 549 236 171 173 553 476 882 569 74 841 910 689 ...
output:
260869097 250249635 252485552 251312537 249827807 247891441 247306872 250706363 246507025 251504505 253441362 252531355 248389010 251206287 251647794 256299060 251419971 256041214 250785378 257137028 247372087 262923110 250837210 248771282 245058822 265251780 251710904 249728123 250029619 252510223 ...
result:
ok 10000 lines
Test #10:
score: 0
Accepted
time: 2ms
memory: 22628kb
input:
1000 10000 107 858 884 149 531 779 189 350 748 934 302 276 957 567 102 902 906 898 373 631 532 743 683 856 625 610 80 863 986 16 322 141 538 352 758 5 656 870 828 180 982 356 308 19 240 422 622 859 850 331 565 472 321 365 962 941 638 188 448 403 864 588 222 22 184 854 300 554 781 711 973 324 283 359...
output:
252498827 250467741 245004582 254567945 248723182 266747940 252248407 250985182 246296872 258740339 250929702 252439407 264653513 256570063 251140559 251878111 245187220 257848088 248480375 257243736 247751395 252036917 250285176 249672867 247804044 247486222 252436982 247016052 254469398 257746086 ...
result:
ok 10000 lines
Test #11:
score: 0
Accepted
time: 0ms
memory: 23060kb
input:
1000 10000 469 92 385 860 536 350 852 471 547 625 369 749 339 169 21 565 312 801 41 996 326 280 660 211 910 75 929 202 768 652 865 4 498 109 179 568 601 167 276 661 297 654 909 958 922 815 515 673 253 771 879 108 682 405 476 418 604 847 225 265 329 270 228 872 571 775 69 180 118 78 35 808 795 412 13...
output:
249086375 263201066 251739073 251359274 253144475 272709870 251828190 252458176 265505472 261406223 268442012 246572070 247852028 276578867 252522304 277213878 270316579 252964972 261401771 275240590 279151202 251157983 259726293 256059004 255499430 253949570 253723754 275131199 250198559 251473808 ...
result:
ok 10000 lines
Test #12:
score: 0
Accepted
time: 3ms
memory: 22216kb
input:
1000 10000 458 237 370 989 962 641 819 68 976 944 204 184 479 612 434 436 765 572 554 959 36 710 891 584 882 521 928 94 263 633 406 833 534 363 513 21 281 745 699 864 669 850 529 315 455 375 292 60 70 685 782 613 344 217 931 862 739 215 691 48 635 940 182 348 188 801 432 8 696 49 236 772 539 757 193...
output:
333833500 333833500 333833500 249545048 333833500 249545048 249545048 249545048 249545048 249545048 249545048 333833500 249545048 333833500 249545048 333833500 249545048 249545048 333833500 333833500 249545048 249545048 333833500 249545048 249545048 249545048 333833500 333833500 249545048 333833500 ...
result:
ok 10000 lines
Test #13:
score: 0
Accepted
time: 13ms
memory: 26684kb
input:
10000 100000 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:
333333340000 333283355000 333233380000 333183415000 333133460000 333083515000 333033580000 332983655000 332933740000 332883835000 332833940000 332784055000 332734180000 332684315000 332634460000 332584615000 332534780000 332484955000 332435140000 332385335000 332335540000 332285755000 332235980000 3...
result:
ok 100000 lines
Test #14:
score: 0
Accepted
time: 18ms
memory: 22812kb
input:
10000 100000 4607 827 2035 8615 3621 5753 3932 7905 1928 4478 5212 6050 9017 7801 9811 9915 9016 8789 8088 1285 7024 2588 9126 5626 2342 820 9729 3840 1698 6592 9503 4539 1200 9586 5650 1792 1370 9214 8008 1578 2937 861 8952 630 5 1549 1691 3823 8220 436 9397 552 3935 9346 9368 3452 6402 4204 1080 9...
output:
249897347061 249896131590 249914750798 250458981867 249010978963 250037157372 248895507307 250697367512 251229099297 251001758448 249307655388 250326734894 249317989317 249618346287 249956029481 249472860797 249424124234 249474623368 249293835077 250221547890 250595811813 249278269199 249412896604 2...
result:
ok 100000 lines
Test #15:
score: 0
Accepted
time: 31ms
memory: 24304kb
input:
10000 100000 3060 5228 9664 4133 7280 6675 1186 4393 5115 3785 1706 4049 9609 8331 584 367 763 3324 3730 2940 7089 9493 6060 8108 148 9067 2686 9080 7945 1886 9097 832 8629 3031 7989 1566 2970 3587 9375 4996 9481 138 4990 6694 1907 590 6692 6447 6970 1429 7316 4663 58 6087 5417 2125 5713 177 6834 17...
output:
249379335677 250564028686 249911690942 248759909742 248942895751 250505472878 249995950694 249424346881 249384707925 250679254354 248794871167 251400405963 250598317733 251055417333 250564452666 249397413463 250591860942 247884917961 248830215526 248556895505 252555537555 250588052750 249442159148 2...
result:
ok 100000 lines
Test #16:
score: 0
Accepted
time: 14ms
memory: 23056kb
input:
10000 100000 1865 8212 6189 8845 5317 6184 6105 8956 4399 7299 3095 9106 3066 8505 2222 3002 3734 1323 8155 7274 6647 5186 6612 9091 9395 3227 6012 5654 6383 2776 7960 4432 4723 9968 8804 5288 86 1785 4093 1346 7818 9246 2185 6951 7814 5103 551 6023 5780 570 5535 6643 9724 7526 7714 8406 4990 8875 2...
output:
249107703017 250929022770 248973455287 251215085728 250154830044 250021851268 248840792334 249317564185 249529439725 250051242908 249104026928 250644846835 250253578971 249451030933 250122048817 250546832164 250567786988 249322165564 249606784865 249266200556 250163660303 249101131436 249618662246 2...
result:
ok 100000 lines
Test #17:
score: 0
Accepted
time: 11ms
memory: 24480kb
input:
10000 100000 6756 1688 6229 8371 1121 6531 1327 3562 1768 8888 6604 6762 515 8098 9301 562 3335 1848 4949 2210 9602 8094 3482 7916 6682 9756 8314 9554 9352 9991 6879 6569 2139 667 5814 2389 6591 4948 7665 3237 3183 9256 3619 1680 8499 3297 2930 721 1685 8677 8295 1328 3836 8333 4957 232 5717 875 547...
output:
249413590668 250313669717 250120939437 251046713667 250338695308 249069427057 249030353190 250713504985 249728489343 250331020584 251118048063 248364056694 250104400530 249896454300 250223547797 250505288965 249857011499 249213206687 251308938646 250067941589 250568941268 251185223377 249006848082 2...
result:
ok 100000 lines
Test #18:
score: 0
Accepted
time: 18ms
memory: 22704kb
input:
10000 100000 6834 9774 8757 6224 7707 567 7008 3983 7254 524 6364 1477 3360 2086 1242 397 1866 8601 4243 842 8164 635 2512 5326 4113 9727 5567 7437 2174 4262 8285 9958 5737 9309 4735 4318 9519 8021 9092 1226 4344 4815 5133 1938 6561 5431 3675 8975 4847 6122 2615 9095 888 323 2061 9479 9150 1664 5442...
output:
249391457751 249144573525 249235798206 249801921233 250866407752 248156473123 251531256938 249672114201 250515294374 250158604394 250019094112 248157388395 258436907150 248759723271 248882610224 250259263845 249819631685 250426409008 250671783525 251038483637 249795464283 249738859699 250546320729 2...
result:
ok 100000 lines
Test #19:
score: 0
Accepted
time: 23ms
memory: 22548kb
input:
10000 100000 4369 1328 3935 2770 3588 597 1455 321 8882 4274 5618 6324 3471 3558 363 2260 5007 1182 8941 4808 1714 1633 1475 5647 4904 2573 9780 8030 8078 3597 9596 1094 3089 7354 1269 1199 5466 2688 461 2537 1966 8300 7448 6270 4780 3410 4631 9156 147 5799 1866 3970 1962 1756 2925 1991 2840 9134 85...
output:
251033524625 253231950867 252486951128 254721597125 250015952915 249953876719 254278282953 250906246099 249552099337 251985200841 251406244446 250380611061 248894069395 248652822754 249522730742 250454568288 250938727619 252355485102 248611902908 250081544502 250134712813 250635393346 248977789292 2...
result:
ok 100000 lines
Test #20:
score: 0
Accepted
time: 20ms
memory: 22700kb
input:
10000 100000 3026 1782 7464 1195 7717 6038 7803 706 9651 7326 6394 2105 4890 612 4484 3101 8048 2242 9406 9816 1080 3787 3325 9987 4473 3067 5801 6524 6669 4429 8628 7072 5133 7387 9026 5291 3730 5217 1602 7497 7067 3669 3534 7194 65 8569 774 8625 5330 7159 7954 2392 4980 6252 4652 3501 110 935 245 ...
output:
250602248329 249576983172 250656406457 249472500232 253038164808 249925949345 252969572313 252481279455 251912755337 249322258206 250976438434 249410519066 250432743063 249337775548 253502925344 249115644605 250407989563 252107917079 257659186636 250576213702 253112589725 250016704234 249269659220 2...
result:
ok 100000 lines
Test #21:
score: 0
Accepted
time: 13ms
memory: 22756kb
input:
10000 100000 7348 500 3092 7277 2466 1248 7957 9799 1156 2378 9172 7374 1683 6717 3461 9831 3949 4752 5885 4804 6771 7019 9537 3243 9279 9409 8567 8073 5661 2269 832 5327 1498 1801 9174 8725 9684 9321 384 3022 3219 9506 2905 1447 9255 1287 4218 9970 4036 434 4035 6990 1691 9727 797 3554 5740 5037 69...
output:
249713496095 251572960796 273358652179 250203360837 249684467947 249981649507 256702986698 258493281910 251000913650 257529116634 257762386417 258553080396 249554932547 256082039347 249089871945 251085141439 263148407860 249766603398 250076696380 250585794082 250421078709 249441934428 251687038471 2...
result:
ok 100000 lines
Test #22:
score: 0
Accepted
time: 7ms
memory: 24292kb
input:
10000 100000 5596 1361 4177 2969 4355 8459 5010 3699 6335 8066 9340 7488 3129 3500 1550 2735 6139 6311 1504 5031 1831 1349 5234 4465 7206 6731 9583 3538 383 8343 1547 3416 5308 3775 1760 3069 4314 9538 7686 2688 2856 3087 9088 3517 8379 2840 8940 9458 2228 6283 7144 1302 8282 8424 6128 5603 2415 408...
output:
250990807036 262710849036 265081133260 250000268787 256020932279 255232771257 249100138964 263257267194 249194046449 262557677158 260603239728 250101620353 250120327286 255811800712 276237681179 276270565452 249227287708 260665939511 249400765380 260367472355 253075178167 251540474368 249470146114 2...
result:
ok 100000 lines
Test #23:
score: 0
Accepted
time: 25ms
memory: 22876kb
input:
10000 100000 7978 1405 715 1391 6719 9230 8184 5401 3695 4139 6776 4122 2997 1436 1806 3918 1612 8203 3579 3902 1312 2819 3506 6477 9228 1664 5987 9908 7785 1477 6072 5474 3824 7599 9591 6462 4068 5883 9574 6566 3963 6043 45 946 43 5263 526 3201 2429 8981 6782 1077 2842 1875 4124 7630 919 4623 8254 ...
output:
333383335000 333383335000 333383335000 250535430898 333383335000 250535430898 333383335000 333383335000 250535430898 333383335000 333383335000 333383335000 250535430898 333383335000 250535430898 333383335000 333383335000 250535430898 333383335000 250535430898 333383335000 250535430898 250535430898 2...
result:
ok 100000 lines
Test #24:
score: 0
Accepted
time: 134ms
memory: 28540kb
input:
100000 100000 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:
333333333400000 333328333550000 333323333800000 333318334150000 333313334600000 333308335150000 333303335800000 333298336550000 333293337400000 333288338350000 333283339400000 333278340550000 333273341800000 333268343150000 333263344600000 333258346150000 333253347800000 333248349550000 333243351400...
result:
ok 100000 lines
Test #25:
score: 0
Accepted
time: 102ms
memory: 24296kb
input:
100000 100000 61555 82194 68976 35412 8728 16203 2581 39440 30590 20735 74158 51400 47403 16772 65795 54329 13045 30530 97530 62526 54173 42091 99112 91772 62032 58622 50904 87604 76024 15346 44159 12950 51840 45765 15955 68414 1619 16299 13709 99865 67904 65156 57778 94076 31712 35253 74106 24813 3...
output:
249647388015760 250234445823718 249806185460873 249577140008548 250067484671349 250464608916830 249836394947969 249966618381394 249885502778435 249879783408634 250230279271940 249916424474899 250018929546917 249756755117483 250113308265798 249929404178550 250119733078566 249811015776215 249814063268...
result:
ok 100000 lines
Test #26:
score: 0
Accepted
time: 148ms
memory: 25204kb
input:
100000 100000 84306 28667 64722 68745 6537 35978 84257 18221 94006 98850 64318 49826 25430 45631 89700 59966 7409 39933 83825 81610 41501 36129 47207 43651 28369 43793 31408 7289 10099 33980 11038 4832 24346 56133 42431 27665 69602 36522 62500 81670 37230 12748 96839 59959 7667 6050 26821 45574 2627...
output:
250423714669152 249789615648121 250234205286537 249701435464202 250196021646068 249535085941640 249734948137766 250072754953551 249585101983454 250037697534933 250551092604887 250110722397745 250262852738145 250061584698901 250230340914361 249983177159135 250158681993083 249271721930308 249614665536...
result:
ok 100000 lines
Test #27:
score: 0
Accepted
time: 137ms
memory: 28560kb
input:
100000 100000 86514 55185 36306 91961 62293 22557 73222 91589 47815 93487 33514 81436 22661 90270 55483 70106 42073 59923 24461 69126 98068 69361 35578 7922 24338 24030 67563 89135 2188 82653 88767 38558 72905 35924 74594 37058 18568 94422 22271 53844 74010 89309 32011 57375 42737 2783 3881 81883 56...
output:
250496196863864 249882748449184 249894052026968 250461004072665 250029752025197 250015454630822 249732279920872 250075219602964 250135137218322 249564309550168 249803503933201 249729557348999 250073556520133 250320666422018 249838660307330 249790484228992 250393476728751 250054992445848 249979947143...
result:
ok 100000 lines
Test #28:
score: 0
Accepted
time: 126ms
memory: 24844kb
input:
100000 100000 60283 64985 98600 67977 88430 76701 82034 89497 45285 7861 18769 64085 42875 12751 55841 10974 89064 11681 40575 55698 77230 37361 60155 63539 40721 33728 16043 25036 34332 36487 64276 22511 9293 56320 30295 91480 35573 14490 56441 16627 40627 17431 78443 3153 60360 39074 95270 85746 4...
output:
249712758585300 249886318310128 249506681030030 250265754825426 250408078339342 249414604931513 249544733316795 249925931610469 250037265123605 249793776858444 250000859996482 250063672110380 249844251380482 250125472947410 249974255497591 250033821056338 249954735774079 250030279856485 249719536614...
result:
ok 100000 lines
Test #29:
score: 0
Accepted
time: 90ms
memory: 25780kb
input:
100000 100000 63030 96428 67162 62477 11290 55004 68924 49377 38895 11270 33074 25989 45939 53566 89860 28991 6719 8534 9785 97730 11361 12260 98360 74822 98172 53138 62131 11432 92329 90923 98274 46035 26323 63073 84766 90915 17601 37915 29583 83706 69809 77854 34351 91230 50765 79499 54793 92570 5...
output:
250077077200397 250140662270095 249928874335447 249851940226980 250183774916146 249646255213213 250297443658924 250074316051133 250029182468541 249864098656678 250245730748942 249921070448217 249536911140956 249895280915332 250254175052400 250080298763626 250022725460918 249841131786793 249996812950...
result:
ok 100000 lines
Test #30:
score: 0
Accepted
time: 113ms
memory: 26132kb
input:
100000 100000 6209 96780 81904 59618 90970 19679 95919 28506 3483 42090 62351 9349 11698 20020 71503 27490 9475 80644 28005 14455 24726 98871 91252 14815 66436 98809 36171 43149 30912 43181 56861 6838 22031 13955 36269 23319 79741 24821 82444 94403 47247 54045 47546 892 23412 84618 60163 76221 69465...
output:
250173218963979 249668093309153 250111405903686 249898937709681 250335707282343 249574192750212 250389846066035 249580230246915 250182399351606 250092529856734 249823639941284 250210340273242 249988241219024 249927773370377 249951219079397 249730130220459 250259993737482 250036739597120 250135304809...
result:
ok 100000 lines
Test #31:
score: 0
Accepted
time: 63ms
memory: 28736kb
input:
100000 100000 91461 60142 95968 36567 28502 60117 42887 54335 68780 24843 54564 29495 71804 30914 76701 46029 19906 7685 77629 3900 73653 36976 92452 18819 11813 52482 48188 69668 92617 64962 60911 53613 4938 68296 92328 95035 72198 90782 359 96390 46361 95789 56749 77213 9099 66325 56037 7708 2951 ...
output:
250026478246768 249610409449763 249819137413844 249770453201165 249544654013892 249945381217349 250051763672224 250115810146459 250183424268946 250069487046217 250000781616253 250268278243025 250435318854461 249778067934913 250204895766524 249911060875782 250330317858597 249883041813569 250482530011...
result:
ok 100000 lines
Test #32:
score: 0
Accepted
time: 66ms
memory: 27444kb
input:
100000 100000 72878 13160 70708 89101 84040 76447 17237 13379 6008 94241 5961 93122 91224 91511 42710 39682 8898 47879 7858 47834 75158 76792 1193 59913 94622 612 55381 43008 48582 99359 48466 16783 63448 67529 99165 66585 13998 11792 9007 70259 11772 76389 90314 15214 9398 90892 84711 76950 70068 1...
output:
249757543266569 249708540713824 250000664763121 250490246360716 249494353090910 250007358322303 250021586944475 248908079597651 250062195903863 250367321018656 249964226855208 249966974124193 249951453410722 250083432437002 250000470933046 249726303415752 250011096641379 249340569337214 249942329486...
result:
ok 100000 lines
Test #33:
score: 0
Accepted
time: 72ms
memory: 23800kb
input:
100000 100000 96504 91232 17734 83342 9722 91342 33234 45243 68980 4809 93311 14958 10857 21455 5476 25888 77265 97894 85853 3672 15567 46397 74157 16515 49606 62903 84190 53173 88359 80157 30959 93261 72433 99761 626 9215 38723 87569 27234 6799 86338 40668 2238 52200 7865 13219 85250 74615 66117 69...
output:
250172426892249 249795025317570 249863547171995 249835814140267 249855736702226 250239575427846 249535665810102 250259933867565 249901219416523 250049111369127 249950740602115 249595168482246 250066580945888 250264198171199 249664114910165 250178874181252 250028237192224 249977412202124 250115403097...
result:
ok 100000 lines
Test #34:
score: 0
Accepted
time: 84ms
memory: 25000kb
input:
100000 100000 85064 55874 92882 89206 51621 80689 66250 20789 45246 92841 90990 94594 38644 60412 28695 69161 72225 63834 20400 58316 51085 24819 48515 18441 64065 94930 94555 73193 29261 43332 58338 44029 63538 33998 21649 12298 6438 18928 44869 51498 65818 92454 16090 698 39823 7514 32736 86252 68...
output:
250963305105831 249557650128883 250187915711030 249571734286936 250719582642606 250000144173864 250392921732021 249772462114253 250333764673352 250098951121022 250219907263876 249944367891561 250081766658438 249911488147997 249910608571204 250006890375877 249835650056077 250142163923774 249770407310...
result:
ok 100000 lines
Test #35:
score: 0
Accepted
time: 80ms
memory: 23388kb
input:
100000 100000 4526 37909 43029 57697 7397 73111 18656 22850 9902 7222 64612 62159 7023 88510 56172 17286 91489 91965 14295 32906 77201 65097 19967 25363 81782 52772 95308 52409 4373 78799 58114 13834 20608 53919 88416 60182 41206 18982 8707 76384 52364 86796 32995 54466 48960 50918 29499 14933 71002...
output:
249891453313584 250332207971534 250351788370735 249839723440629 250831905368907 251042072985668 253595026713092 250083989698376 250217393114924 250229031676326 250579645845342 249853655951948 250214736838501 250037384355493 251647642680522 250025361072740 249593325452780 250066339377529 250175723328...
result:
ok 100000 lines
Test #36:
score: 0
Accepted
time: 76ms
memory: 24336kb
input:
100000 100000 73141 83229 72840 22376 97080 74750 82860 61056 69261 36337 654 67294 8402 2231 34804 65592 24820 32496 32388 43090 72111 36992 92685 95691 3377 24320 85626 32932 19498 72407 12820 38792 31072 18077 3545 18804 95339 67629 18895 19510 23323 39204 86561 24013 66501 76178 1003 15757 64571...
output:
251926388335535 250644918590124 250355137971118 249854100271301 250222376225694 249696869389241 250655286123732 250446984022544 251641711111573 250149129212972 250141768537948 251150384159635 250013849461139 250120396328322 250336189377534 250152829577488 250275392789035 251363703485679 250237112161...
result:
ok 100000 lines
Test #37:
score: 0
Accepted
time: 67ms
memory: 22392kb
input:
100000 100000 58491 75537 97442 26920 56896 27927 74173 84006 73839 98226 35431 41396 32245 314 71310 67365 73 90658 2295 96094 83726 85513 59486 9471 8818 46342 94479 12683 34344 81250 57073 24374 56791 64294 46385 77206 12650 76712 61449 74569 74172 15013 65554 58655 259 79177 7559 3005 32238 2128...
output:
257991533409439 256879104633514 249961843297853 256831581986588 249922399597847 250098037971497 250073302432138 257981941295584 257344691965214 250116102076425 250844379624764 250657370541100 249937222018809 258440993164391 250651343482516 250244350043462 250339028511676 249956901076931 258985554163...
result:
ok 100000 lines
Test #38:
score: 0
Accepted
time: 82ms
memory: 24216kb
input:
100000 100000 74924 96271 48068 30513 23758 40502 24550 53897 65882 25226 91101 93182 71268 982 29725 59576 12926 47323 47958 25181 57678 98817 82351 84223 4252 70511 70210 15166 64138 12202 75607 92889 61671 53250 26634 67705 93845 87045 67118 65753 90270 54879 59649 96434 81774 71141 68238 26174 8...
output:
250712832372106 250340805329145 268856485419933 250251412818949 250416013725048 263852306669650 254272228066970 250067199612141 250498130066186 292853298947181 249926409246240 256326907391031 250378078776261 261680146262486 262412484834403 271754368786079 260664487119520 250167204672577 275134075526...
result:
ok 100000 lines
Test #39:
score: 0
Accepted
time: 136ms
memory: 22956kb
input:
100000 100000 52097 68863 52117 46432 97213 67741 37291 45983 1323 83193 15818 60053 86697 98629 31065 35541 56562 46393 33659 10283 61212 46557 70748 54906 90183 71974 2570 72196 14106 20123 71647 9194 92979 24862 34023 28567 61091 61331 11319 82901 84946 28058 60370 6786 46850 18400 21440 79986 24...
output:
249909907207244 333338333350000 333338333350000 249909907207244 249909907207244 333338333350000 333338333350000 333338333350000 249909907207244 249909907207244 333338333350000 333338333350000 249909907207244 249909907207244 333338333350000 249909907207244 333338333350000 333338333350000 249909907207...
result:
ok 100000 lines