QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#197085 | #1167. Expected Distance | Y_B_X | AC ✓ | 62ms | 34688kb | C++14 | 1.8kb | 2023-10-02 11:10:17 | 2023-10-02 11:10:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1e6+10;
const int mod=1e9+7;
int n,m;
int a[N],s[N],c[N],d[N];
int invs[N],mul[N],invm[N];
int tmp[N],itmp[N];
inline int qpow(int x,int k){
int res=1;
while(k){
if(k&1)res=1ll*res*x%mod;
x=1ll*x*x%mod;k>>=1;
}
return res;
}
inline void getinv(int *f,int *g){
int i;tmp[0]=1;
for(i=1;i<=n;++i)tmp[i]=1ll*tmp[i-1]*f[i]%mod;
itmp[n]=qpow(tmp[n],mod-2);
for(i=n;i;--i)itmp[i-1]=1ll*itmp[i]*f[i]%mod;
for(i=1;i<=n;++i)g[i]=1ll*itmp[i]*tmp[i-1]%mod;
}
char ch;
template<typename T>
inline void read(T &x){
x=0;ch=getchar();while(ch<48)ch=getchar();
while(ch>47)x=(x<<1)+(x<<3)+(ch&15),ch=getchar();
}
void write(int x){
if(x>9)write(x/10);putchar(48|x%10);
}
inline int add(int x,int y){
return x+y<mod?x+y:x+y-mod;
}
inline int sub(int x,int y){
return x<y?x-y+mod:x-y;
}
inline void cadd(int &x,int y){(x+=y)<mod||(x-=mod);}
inline void csub(int &x,int y){(x-=y)<0&&(x+=mod);}
int main(){
read(n);read(m);int i,x,y,ans;
for(i=1;i!=n;++i)read(a[i]);
for(i=1;i<=n;++i)read(c[i]);
for(i=1;i<=n;++i)s[i]=s[i-1]+a[i];
getinv(s,invs);invs[0]=mul[0]=1;
for(i=1;i<=n;++i)mul[i]=1ll*mul[i-1]*
(s[i]+a[i])%mod*invs[i-1]%mod;
getinv(mul,invm);
x=0;
for(i=2;i<=n;++i){
d[i]=add(add(c[1],c[i]),x);
cadd(x,2ll*c[i]*a[i]%mod*invs[i]%mod);
}
for(i=0;i<n;++i)c[i+1]=add(c[i],
1ll*a[i]*a[i]%mod*invm[i]%mod*d[i]%mod);
while(m--){
read(x),read(y);
if(x==y)putchar(48);
else {
if(x>y)swap(x,y);
if(x!=1){
ans=sub(add(d[x],d[y]),
add(2ll*mul[x-1]*invs[x]%mod*invs[x-1]%mod*c[x]%mod,
2ll*a[x]*invs[x]%mod*d[x]%mod));
}
else {
ans=sub(add(d[x],d[y]),
2ll*a[x]*invs[x]%mod*d[x]%mod);
}
write(ans);
}
putchar('\n');
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 3ms
memory: 17888kb
input:
5 7 1 1 1 1 1 2 4 8 16 1 3 2 5 4 3 1 5 3 3 4 5 1 2
output:
7 666666697 15 666666697 0 333333366 3
result:
ok 7 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 17840kb
input:
5 4 17 19 23 29 2 3 5 7 11 1 2 3 4 5 2 3 5
output:
5 927495315 106531441 450222593
result:
ok 4 number(s): "5 927495315 106531441 450222593"
Test #3:
score: 0
Accepted
time: 2ms
memory: 17884kb
input:
300 2000 628 484 811 549 1413 882 563 566 579 667 95 236 38 440 1982 504 57 836 6 193 1065 398 1006 1921 314 1260 307 1684 210 931 1911 492 1900 80 77 1727 1255 834 1903 7 1621 1581 1320 769 1516 616 1130 1055 40 976 186 1414 119 499 1823 913 1179 1750 1398 444 1884 1760 497 1225 1460 156 291 1519 1...
output:
395700754 150111137 821721623 173118822 536662744 378036497 796019482 853062166 463844696 517450135 256746985 734477854 90504620 938938019 916831280 490634464 501977659 884006900 330998825 213677227 682487282 587972806 198978737 849426806 731383836 325332584 841671732 235136882 504986696 106275548 3...
result:
ok 2000 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 18028kb
input:
300 2000 756 1329 1556 1323 666 1658 547 1850 1438 1553 1239 1979 128 169 1601 1317 1779 394 24 434 1005 176 515 304 171 1980 528 737 1227 97 33 1274 192 216 890 1623 1281 205 436 1414 618 991 1101 1927 1513 1700 1942 1299 1762 1442 1107 658 508 23 527 147 770 371 1253 952 1395 569 536 503 1491 1522...
output:
188298385 318988678 247205831 501136147 168851879 411821418 458174705 915014853 463883234 552230620 910410090 777175629 548459050 478584760 510984782 251261077 901746774 346916033 286905461 524294965 833117781 372868501 507679194 701590021 580468941 593375771 492076259 513167008 876785472 900638484 ...
result:
ok 2000 numbers
Test #5:
score: 0
Accepted
time: 2ms
memory: 17880kb
input:
300 2000 181 877 814 1696 1728 1731 722 542 298 1031 1678 1019 731 602 628 1234 1693 144 746 1379 754 466 24 1983 28 188 46 894 643 1967 555 841 1779 1648 1191 736 715 279 1674 628 718 1106 1586 382 1702 783 754 839 1676 101 221 1710 497 1948 719 1381 1657 992 1300 756 1099 1186 575 1781 1522 1079 5...
output:
165169134 198829617 543723880 901437541 572625331 602539696 572354665 339547812 143520816 152435007 131092924 950658881 775231979 506853154 298960074 375087408 404016177 61014537 779535375 89267940 151251307 581835930 670436225 315123128 298337870 65613929 865333075 437153716 105429974 442475945 183...
result:
ok 2000 numbers
Test #6:
score: 0
Accepted
time: 0ms
memory: 17940kb
input:
300 2000 309 1017 1368 1174 981 700 705 530 453 1214 1222 763 821 139 439 1152 120 1702 764 1428 1207 244 1534 366 1293 396 267 458 955 1134 1781 1111 774 1785 1300 1336 1444 354 1616 739 1011 324 1367 836 1890 571 1565 379 1590 568 1335 1466 1591 1472 1615 1128 1248 317 1155 368 18 1803 1910 867 25...
output:
569754891 594343271 761401371 58126761 924157630 589225107 831948501 503922970 273325110 648860467 747225346 766431715 773118780 110812890 938446299 678926596 976040834 593315952 556997714 850882110 896723111 42486258 563444840 866501327 761498538 412648768 45639628 451253769 47979121 63827677 49771...
result:
ok 2000 numbers
Test #7:
score: 0
Accepted
time: 2ms
memory: 17832kb
input:
300 2000 1733 1670 113 1356 939 773 1585 1814 1313 100 365 1610 911 573 1466 1069 738 157 782 373 955 21 851 238 1150 413 488 1511 372 1004 1200 1190 169 1217 112 1040 174 1725 853 146 1112 439 956 1995 591 1142 377 623 208 1227 1153 1813 876 1588 511 362 839 938 1202 877 1721 1908 1949 848 480 1105...
output:
926038274 483413972 718458249 664810915 150756945 194626435 486016441 924883321 169820217 924669827 848288555 477178869 759354528 910697980 626236744 194943443 852910426 178282672 500977234 608221505 39883089 281913328 671147930 808207421 801442756 891016177 461625440 957344238 960151479 655994476 5...
result:
ok 2000 numbers
Test #8:
score: 0
Accepted
time: 0ms
memory: 17960kb
input:
2000 2000 1751 1586 47 366 1872 1783 1953 844 1923 1543 363 394 1504 491 646 1197 1466 816 799 1369 266 645 105 1739 1913 224 985 176 698 1914 936 395 1950 446 1301 1747 1821 1550 176 34 1828 606 704 487 1633 215 1950 1221 793 1830 376 1298 915 1722 1087 1817 187 1705 1593 456 1360 1691 1407 307 168...
output:
730715903 738203652 635915290 143494197 951707551 696298849 776808849 66328648 425386385 114679544 240153572 917910122 480649021 723534584 372925848 241461455 385714432 980119678 160978811 948214416 474205659 491355945 390562638 132071126 831339481 674279393 773221566 284572628 704213398 689455778 6...
result:
ok 2000 numbers
Test #9:
score: 0
Accepted
time: 0ms
memory: 17900kb
input:
2000 2000 1879 942 792 547 1126 560 1232 832 783 1726 1506 1946 298 925 969 1306 1189 1078 1521 1610 14 423 1422 122 474 1137 1206 525 306 1080 1650 665 945 1175 114 347 551 1625 1414 1249 121 1825 1189 1645 1822 1299 1466 761 515 1592 194 1054 1305 350 1791 1755 1970 326 744 68 1767 1204 743 1392 4...
output:
125719485 32723123 813899527 585328332 135914605 981419660 769593851 640765873 604536400 539618878 500168943 700959665 936615430 892248391 61584827 503907570 703947603 768180923 177289749 141852407 126138115 368111456 122126156 604028076 660641810 45634662 250925461 487620233 276433729 811733852 501...
result:
ok 2000 numbers
Test #10:
score: 0
Accepted
time: 2ms
memory: 17984kb
input:
2000 2000 599 1083 50 25 1483 633 112 820 938 1908 1946 986 389 1166 1484 1223 511 828 1539 1659 1955 201 228 1993 331 1153 1427 1386 618 950 876 40 340 1311 222 51 1281 996 651 655 222 1939 970 100 1819 382 1573 301 1133 955 603 297 1294 1171 1983 990 856 947 791 1873 1278 1118 782 670 452 1128 128...
output:
59970741 30477604 435418030 650118160 643539903 724377442 346366580 403950537 254024957 80099732 447203725 904934883 238083498 128391045 237028209 555276667 309652098 488709673 333302192 951703450 779136690 587108294 939804853 959418485 204119483 932904907 957485270 239145274 411023583 479971030 125...
result:
ok 2000 numbers
Test #11:
score: 0
Accepted
time: 0ms
memory: 18048kb
input:
2000 2000 727 1927 796 207 737 1602 95 1512 1094 90 385 1433 479 895 1807 1140 234 1090 261 604 407 1786 1737 1080 188 1361 1840 951 1443 821 103 310 1927 743 1035 1355 715 1071 593 766 514 1350 559 554 8 170 193 545 1751 718 421 1349 1683 1991 1583 224 447 272 1350 381 982 1735 1925 1948 675 686 10...
output:
254831389 150637904 865315979 594551996 777303202 644785661 631574986 738835193 327128480 469961468 38331738 754760554 66099797 257234966 777460136 634167862 636995083 268936023 42018578 985923959 852881110 839530555 741418036 920866290 951229355 367921767 291326488 561044285 699751423 154550785 909...
result:
ok 2000 numbers
Test #12:
score: 0
Accepted
time: 2ms
memory: 17952kb
input:
2000 2000 151 772 53 980 502 1082 270 796 657 272 1529 473 1273 1136 1426 1057 148 841 983 844 156 1564 1246 760 1453 1569 61 1299 1051 691 225 1092 218 880 40 1059 932 1850 1830 1981 615 1272 1044 1713 708 550 1004 85 1665 80 1343 1105 1672 619 1775 162 38 893 1205 1993 493 544 1964 1930 1410 51 15...
output:
57157118 456735241 623955454 796084954 660118393 679865115 68385603 613974249 762075565 252159237 638224921 652109552 915716624 140176271 753220616 981032675 70118094 390954289 250690922 966828221 465488242 430674779 797459616 319006515 710855489 139728429 440497918 179167543 884463415 751658086 578...
result:
ok 2000 numbers
Test #13:
score: 0
Accepted
time: 29ms
memory: 18024kb
input:
2000 300000 1248 1352 305 1049 1991 1285 1246 517 730 857 1052 355 1395 1858 1573 1923 718 851 1224 920 925 546 1225 1036 852 24 95 1258 702 1844 598 275 182 1832 1227 106 271 1658 483 8 1309 613 1347 968 938 597 1129 588 850 1743 1250 1382 1319 982 610 1728 733 1431 1583 181 271 318 1750 405 1576 6...
output:
520388099 816827929 109229905 687685749 57407356 192016153 729714541 184532388 304476632 289472509 895123122 459095808 423726137 142980781 523003874 549227951 316799775 742122183 448587211 837035867 848154779 68308289 520787332 227586633 903515674 143276816 881382067 953487321 88919288 350753147 528...
result:
ok 300000 numbers
Test #14:
score: 0
Accepted
time: 29ms
memory: 18052kb
input:
2000 300000 1968 196 859 1231 1949 61 1934 1801 1590 1039 1491 99 1485 291 600 736 632 1113 1242 1161 865 323 735 715 1413 232 1613 119 1014 1522 1824 1057 1769 1264 40 514 1705 1029 1720 1414 898 23 1832 127 1126 385 644 128 764 209 364 434 412 1803 1506 770 324 52 926 1793 486 1127 1789 979 1608 3...
output:
680780542 30939805 469276249 476558034 215979245 211450219 762877517 244886615 103882429 741118742 865703178 75923012 216229514 958732188 161373028 5254340 641152947 912792227 451774631 168575321 975565926 501636494 941531147 316647348 732054087 489847149 453538310 865342252 71882719 404477636 42053...
result:
ok 300000 numbers
Test #15:
score: 0
Accepted
time: 25ms
memory: 17860kb
input:
2000 300000 97 1040 1604 4 1010 1030 109 493 449 1925 443 1650 279 533 411 653 355 864 668 1210 1318 101 244 1291 1270 248 1834 1172 1134 1985 1946 1328 1869 1401 341 1114 1731 1104 958 1333 1703 138 909 581 1315 1469 752 372 1382 868 181 190 1697 431 1698 709 1211 865 782 301 189 1745 1124 961 343 ...
output:
256619451 261372751 911692531 329922491 73722848 110226102 156114405 110101092 723312913 337964237 863775301 505913116 52758092 366350675 598962732 712201289 936565614 155637535 496171614 982326789 464553633 965122740 727778035 105596719 984669596 68089243 107071336 482802795 995326001 770703921 143...
result:
ok 300000 numbers
Test #16:
score: 0
Accepted
time: 29ms
memory: 17988kb
input:
2000 300000 1521 1885 862 186 264 1807 92 481 605 1404 882 1394 370 966 1438 570 269 422 686 155 1066 1687 1561 970 1831 1161 55 33 1447 1855 1172 702 160 641 449 1523 1164 1883 195 740 1996 60 1202 1036 1312 552 267 1912 2000 1335 591 1434 790 1251 594 1943 802 190 829 106 597 1658 460 47 374 1359 ...
output:
483893769 612982945 163539490 245112331 914247450 284753251 984606924 26688522 391264277 23204936 819276006 52332446 173572095 756615904 962409206 458313744 899524438 845342422 381404047 71161329 109110757 914652709 459527796 102121442 856007838 928669556 477305829 854215357 977431829 590906446 7942...
result:
ok 300000 numbers
Test #17:
score: 0
Accepted
time: 26ms
memory: 17896kb
input:
2000 300000 945 537 312 1664 813 584 75 469 760 1586 618 434 1564 503 1057 487 1992 876 1408 395 1711 1465 367 1353 1880 1369 1572 1086 1567 1725 1694 973 1747 73 1262 123 598 1254 1433 146 96 1471 1687 386 205 1636 375 1452 1722 1993 409 486 76 72 1490 1177 393 811 684 1910 108 1171 1795 1325 597 9...
output:
360749869 810296291 330485099 521839287 566555494 830784267 333626007 249845082 633462548 44095264 401408877 536993210 911539029 671169995 531133173 467612895 63811377 91781028 264891760 857458374 184442932 158049774 860945325 74520857 21139344 311746338 338563083 915048258 959800476 183488520 62984...
result:
ok 300000 numbers
Test #18:
score: 0
Accepted
time: 5ms
memory: 22832kb
input:
100000 100 981 1186 1568 1392 463 1112 1016 1751 1994 502 1756 388 165 441 1326 455 1413 1698 4 1073 338 262 1640 204 775 1983 1656 1952 1205 41 311 318 1216 6 187 1417 1472 363 1965 1080 1666 257 524 1846 869 948 506 1666 526 1511 125 1920 1876 1551 639 565 548 115 1039 1086 1646 483 1726 1434 758 ...
output:
533130921 931584078 48641565 910901625 268430380 309648394 801531564 491194349 230122441 529211088 953487773 868970611 412642911 960220891 649697595 61123754 905185471 552601805 291618551 783275524 709709034 608713945 386168574 482599023 620657530 205156548 848329866 270914490 912464923 410841832 28...
result:
ok 100 numbers
Test #19:
score: 0
Accepted
time: 7ms
memory: 22824kb
input:
100000 100 1109 31 122 1573 229 1185 488 1739 853 684 196 1428 256 682 945 1268 1328 1256 726 1122 278 1848 445 587 632 1999 1877 301 221 1911 1729 1101 1315 1438 295 530 202 1734 1202 295 1767 1475 1601 301 1762 928 22 1206 952 874 1239 459 1161 371 832 1608 139 736 190 1595 53 396 1766 712 789 403...
output:
250971859 148216243 879821616 94891896 409551438 338805732 2579071 970960692 912959407 350082264 432682288 320579188 100155983 312188534 406580475 374183341 706808894 572276818 458783314 292835098 588177282 875140769 88784249 2069163 990643166 167318712 522069286 678865153 512609562 534001495 218943...
result:
ok 100 numbers
Test #20:
score: 0
Accepted
time: 0ms
memory: 22716kb
input:
100000 100 1237 1979 1572 1051 1482 1962 1175 431 1009 867 1339 1172 1050 411 164 1185 1754 814 744 771 27 329 1954 970 1385 207 99 1866 1638 1590 955 667 902 871 1108 426 1636 513 440 406 60 1590 1894 947 1758 12 129 746 866 637 161 215 254 999 1728 842 1026 1357 45 1207 268 1909 1805 694 820 1064 ...
output:
57313407 684445910 744323991 449893157 135249868 442210254 837511257 897416179 407196062 648850566 115487581 724801822 798952796 642549108 793851374 465115985 209058498 985449622 771038386 780283855 529157612 3615114 291260093 158151187 527231558 675083715 289050683 151457882 60283557 930199651 8654...
result:
ok 100 numbers
Test #21:
score: 0
Accepted
time: 9ms
memory: 22824kb
input:
100000 100 1957 1528 125 1232 544 931 1158 1715 1164 1049 1779 211 1140 652 1783 1102 372 564 1466 1012 479 1403 1272 649 1242 1120 1616 727 1950 756 1478 938 1193 303 1217 834 1662 780 1678 1812 352 1000 379 106 1947 1799 1645 990 1484 1999 1274 1267 244 1820 624 780 616 682 796 1011 1972 1822 1140...
output:
730216491 217097054 328059970 684929135 877874244 722352831 386420540 48093987 71994100 96755204 44628804 244360931 523945549 56972620 159479681 916774917 662624132 263022326 325657360 863127380 975009253 991826091 995858135 634561426 554678986 373763236 547379401 769078583 808607369 243622711 42553...
result:
ok 100 numbers
Test #22:
score: 0
Accepted
time: 9ms
memory: 22444kb
input:
100000 100 85 1668 871 710 1093 1708 1334 407 24 1231 923 467 334 1086 1002 1019 95 827 188 1765 228 989 781 1032 1099 1136 1837 1780 262 626 1600 1016 588 439 222 1434 1095 150 915 1027 453 923 160 560 136 883 1752 530 102 1762 388 511 825 448 816 15 1503 1303 1947 223 1483 631 1179 1249 1074 1987 ...
output:
689237650 728673625 129493509 676413120 977366461 98896377 354845929 80962731 778960585 455415680 92128654 292530389 869644948 232568307 574890865 26832990 681403513 923173248 187891247 710657721 730562188 989127487 360555543 237500537 185805156 790039613 910468368 675031060 513497030 783791522 3738...
result:
ok 100 numbers
Test #23:
score: 0
Accepted
time: 62ms
memory: 31400kb
input:
300000 300000 243 1798 1723 656 1613 1222 260 119 1253 459 403 1759 887 180 95 1619 710 1620 758 815 1674 1075 968 1078 45 381 905 1885 685 177 1315 1789 222 259 594 1380 565 1674 406 1717 861 1282 1364 147 1382 860 853 1162 593 601 230 1671 661 1763 1607 1802 142 693 12 1739 1640 1501 1951 1843 712...
output:
34620814 311994496 930074120 315545302 471102603 765916663 640495122 698530834 188019097 126881191 921220011 779759477 182369507 131885320 771004227 106759012 991597292 915194036 637914466 775888988 132742356 259949118 738512273 823074825 961960336 471958595 567901466 280757118 297803817 500907725 7...
result:
ok 300000 numbers
Test #24:
score: 0
Accepted
time: 54ms
memory: 28936kb
input:
300000 300000 963 642 469 1029 1571 1999 1140 811 1408 641 138 799 1681 1717 1314 240 625 74 776 864 127 1365 1773 1461 1902 589 1126 1450 102 47 541 59 513 395 894 1788 1295 1045 1643 1827 1154 1397 1145 602 1379 1239 1665 1998 1211 1772 1344 722 459 584 503 1741 1732 18 571 1351 1152 822 582 1120 ...
output:
168822365 212977700 39708503 764970396 222903249 540365555 10530832 361962929 576524532 682006173 778378375 509826088 418463046 199292659 231107230 553658030 306324169 437427884 341239544 246270677 319658774 265140531 171036347 213631494 142093143 698237957 128138354 602176886 661401099 132650949 16...
result:
ok 300000 numbers
Test #25:
score: 0
Accepted
time: 54ms
memory: 29572kb
input:
300000 300000 1091 782 1726 507 633 72 1123 799 1563 824 1282 351 1771 150 933 349 347 1632 202 1809 1875 1142 1282 1332 463 605 1347 1606 1118 1917 1767 842 100 1827 1707 389 24 1120 881 1042 1255 1319 734 1056 271 1219 477 242 1125 1727 458 1966 1040 1916 1399 975 1915 638 1914 1860 855 927 621 11...
output:
341368112 231099419 943917867 210245463 873223162 179685539 857739923 262961898 814178828 480343413 187826430 291944872 580381252 27927470 882587282 368887192 939954433 76652767 133538537 529880546 291270083 588711746 190009189 434146573 500254610 154074833 816568208 439774274 839374485 150221863 15...
result:
ok 300000 numbers
Test #26:
score: 0
Accepted
time: 56ms
memory: 34688kb
input:
300000 300000 515 1627 472 688 1886 1041 1298 83 423 1006 1722 1390 965 392 152 266 774 87 412 754 1624 920 1304 420 1024 1517 865 659 1238 380 1185 408 391 1964 1816 797 1458 491 822 449 1548 730 1219 215 460 303 392 486 1743 194 1571 1722 837 32 295 914 1506 555 1769 1664 1774 249 1956 1676 1702 4...
output:
547119900 641066153 310330771 118702125 153926671 353997731 937287516 825223876 59887897 746346666 261940585 135424621 492629677 191859398 65973927 958676192 82890004 499169134 151636349 870359360 566278797 192453357 672792163 147880859 183485796 286369570 246134072 406554754 43774558 91998974 95781...
result:
ok 300000 numbers
Test #27:
score: 0
Accepted
time: 55ms
memory: 32504kb
input:
300000 300000 643 471 1730 1462 244 1818 1281 775 578 1188 865 1838 1760 825 1771 183 1392 1645 1134 802 1564 506 813 99 881 430 1086 224 847 250 1707 486 490 1396 821 693 380 1270 1356 1663 353 844 1000 861 457 1386 1908 1322 1465 852 493 774 122 1365 487 1956 1097 1176 1624 1276 1477 354 1995 1658...
output:
179990414 97808359 590246203 755206145 783227397 200841924 961635023 118579929 130252670 519856375 1131283 182200520 120485728 23387381 36541036 621131407 663245783 183419203 776578650 876117133 424467843 242397641 430900706 627914273 548753895 197302853 298473943 415991807 626141723 298813316 35408...
result:
ok 300000 numbers
Test #28:
score: 0
Accepted
time: 53ms
memory: 27112kb
input:
300000 300000 1363 1123 987 940 1497 594 1969 763 734 1371 1113 878 1850 362 990 100 1115 1395 1152 1747 17 284 322 482 1442 446 1307 1085 967 120 1638 757 77 1532 929 1805 1110 1536 1298 1774 645 63 781 1315 645 1174 15 1566 83 1319 311 18 1407 1481 1191 1190 176 693 375 1784 989 971 35 936 1764 17...
output:
614734661 535234024 251503558 335034972 361255371 881044302 160939415 414787909 359232653 346762815 966782637 754210662 368832174 953770018 583189303 771703495 153242472 483784911 737551822 857094254 226279199 726378327 962216816 306200924 235780823 805939268 208251997 671217862 129063385 23003095 3...
result:
ok 300000 numbers
Test #29:
score: 0
Accepted
time: 55ms
memory: 27952kb
input:
300000 300000 1491 1968 1733 1313 751 1563 1440 751 297 1553 1552 621 1940 795 609 17 1029 953 1170 1796 1765 765 1127 353 1491 654 824 138 1280 1798 1056 835 368 261 1038 1701 1839 907 535 1181 746 177 1074 474 834 257 1531 1810 1997 1978 720 1069 501 1005 1383 1129 1766 1314 1526 1588 692 1588 666...
output:
155589929 267652238 231094642 122632417 624322461 102894823 792772204 297425787 958015096 847014031 700657728 542997022 159385009 552113584 801095755 591882086 553817025 796239401 993726352 693496259 815727994 709187578 32304705 118905431 435387196 229881341 568815735 714143990 548475781 729631130 2...
result:
ok 300000 numbers
Test #30:
score: 0
Accepted
time: 50ms
memory: 29828kb
input:
300000 300000 1619 812 287 791 1812 1636 127 739 453 1735 696 1469 734 333 1636 831 751 1216 597 741 1706 351 445 736 1348 1566 1045 999 1592 965 282 1106 1764 397 1851 109 569 982 1773 1099 1039 100 855 928 831 237 1638 1350 615 444 1834 121 1786 930 279 363 1357 1935 1573 1201 907 397 513 3 530 64...
output:
157446573 429006488 702428079 157009402 709877075 429066795 79377038 863198387 375729317 478186499 167704649 963130167 162769785 382012781 478085624 91979353 754281974 917817286 311011127 990760162 679752084 227547325 847355554 163994143 207891673 271665619 919967518 503037795 252134194 673409876 48...
result:
ok 300000 numbers
Test #31:
score: 0
Accepted
time: 53ms
memory: 29628kb
input:
300000 300000 1043 953 1032 973 1066 413 303 1623 608 1917 432 1213 825 766 1447 748 666 966 615 981 1455 1425 1954 1120 1205 1583 1970 1860 1008 835 804 1184 55 1637 152 518 3 353 818 506 1332 1510 1340 87 1020 616 1154 890 1233 1103 1652 1365 1071 454 1175 301 244 1260 1428 1709 611 310 1848 577 7...
output:
909371149 218135718 699189862 466522916 404995617 622056029 485282028 667359884 394920362 299420615 963702012 416027417 768852283 952532661 394080615 320290491 480492673 18601352 577063331 52517743 916821158 895903085 604570326 262772532 667446667 556420338 14233902 209969171 647173757 545830788 964...
result:
ok 300000 numbers
Test #32:
score: 0
Accepted
time: 59ms
memory: 32376kb
input:
300000 300000 699 214 1375 681 901 453 1250 1020 1768 1703 1492 915 935 1676 1544 494 568 1112 1559 1618 230 1265 1853 1753 830 867 1689 655 226 1852 993 1286 1113 1200 76 51 1741 1590 1750 1695 1419 1048 1439 1174 535 1431 316 427 549 1654 405 578 1185 570 661 261 744 224 686 720 1005 711 962 517 8...
output:
46787549 671884074 658951837 381533602 393729205 925640274 103274486 704950304 943653924 160399790 729995572 873058082 199992703 654122058 902795304 164229089 659793670 104459876 472499124 389749744 788943331 847669782 414297024 357600764 289162309 851370770 789139394 173686529 235734080 248661503 1...
result:
ok 300000 numbers