QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#51407#1443. Potato ShuffleGuanYunchangWA 89ms10108kbC++111.2kb2022-10-02 13:24:212022-10-02 13:24:24

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 3712kb

input:

3 7
5 2 4

output:

3

result:

ok "3"

Test #2:

score: 0
Accepted
time: 2ms
memory: 3780kb

input:

5 4
1 2 3 2 1

output:

10

result:

ok "10"

Test #3:

score: 0
Accepted
time: 1ms
memory: 3876kb

input:

6 4
9 10 1 9 8 9

output:

1

result:

ok "1"

Test #4:

score: 0
Accepted
time: 2ms
memory: 3720kb

input:

8 0
4 9 2 9 2 3 9 10

output:

1

result:

ok "1"

Test #5:

score: 0
Accepted
time: 2ms
memory: 3764kb

input:

5 3
9 8 1 9 8

output:

1

result:

ok "1"

Test #6:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

6 12
4 7 2 9 1 9

output:

60

result:

ok "60"

Test #7:

score: 0
Accepted
time: 2ms
memory: 3772kb

input:

10 18
9 6 3 9 5 3 9 9 5 1

output:

37800

result:

ok "37800"

Test #8:

score: 0
Accepted
time: 2ms
memory: 3764kb

input:

1 13
5

output:

1

result:

ok "1"

Test #9:

score: 0
Accepted
time: 2ms
memory: 3752kb

input:

4 7
10 4 4 8

output:

1

result:

ok "1"

Test #10:

score: 0
Accepted
time: 2ms
memory: 3788kb

input:

2 4
3 3

output:

1

result:

ok "1"

Test #11:

score: 0
Accepted
time: 2ms
memory: 3784kb

input:

3 12
8 1 6

output:

3

result:

ok "3"

Test #12:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

9 3
3 10 5 8 9 1 3 1 9

output:

1

result:

ok "1"

Test #13:

score: 0
Accepted
time: 2ms
memory: 3720kb

input:

10 19
8 9 6 8 3 5 8 8 8 2

output:

30240

result:

ok "30240"

Test #14:

score: 0
Accepted
time: 1ms
memory: 3824kb

input:

3 8
3 8 7

output:

1

result:

ok "1"

Test #15:

score: 0
Accepted
time: 2ms
memory: 3784kb

input:

5 6
8 7 6 8 3

output:

1

result:

ok "1"

Test #16:

score: 0
Accepted
time: 2ms
memory: 3656kb

input:

10 4
4 6 7 7 7 5 10 8 9 5

output:

1

result:

ok "1"

Test #17:

score: 0
Accepted
time: 2ms
memory: 3784kb

input:

3 5
9 5 8

output:

1

result:

ok "1"

Test #18:

score: 0
Accepted
time: 2ms
memory: 3868kb

input:

1 15
4

output:

1

result:

ok "1"

Test #19:

score: 0
Accepted
time: 2ms
memory: 3784kb

input:

4 0
9 2 8 9

output:

1

result:

ok "1"

Test #20:

score: 0
Accepted
time: 0ms
memory: 3720kb

input:

7 10
4 1 9 9 7 8 6

output:

7

result:

ok "7"

Test #21:

score: 0
Accepted
time: 1ms
memory: 3784kb

input:

9 15
9 10 10 9 1 2 2 9 3

output:

1512

result:

ok "1512"

Test #22:

score: 0
Accepted
time: 2ms
memory: 3780kb

input:

2 12
4 9

output:

1

result:

ok "1"

Test #23:

score: 0
Accepted
time: 3ms
memory: 3820kb

input:

941 1050595461
97199151 967582202 627391061 648812583 382698254 725831431 99920429 942104929 638728093 697787100 277585567 423990676 376336278 986391434 449561958 800545732 3456798 386231691 307296784 129242596 740319256 218489131 899192544 344153713 971619078 363368462 206242305 149813823 430534965...

output:

731201602

result:

ok "731201602"

Test #24:

score: 0
Accepted
time: 3ms
memory: 3832kb

input:

931 1802136692
972656407 966750261 14838713 725079303 96491328 170902145 865911285 121473856 881400060 115397807 343248192 713973122 693395876 845120872 810689262 697741053 598095593 117050186 62294356 887558804 107838689 348014209 207407232 962013618 291145455 44153613 619738233 106508008 266410860...

output:

910622578

result:

ok "910622578"

Test #25:

score: 0
Accepted
time: 0ms
memory: 3836kb

input:

908 396822628
848113662 965918320 549770012 801346023 810284401 763456507 631902141 300842783 124072027 680492162 556394465 3955568 10455474 556366661 171816567 594936374 340218037 700385033 669808280 498391365 475358123 477539288 515621920 579873524 758155480 724938765 885750512 63202193 102286755 ...

output:

701616507

result:

ok "701616507"

Test #26:

score: 0
Accepted
time: 0ms
memory: 3940kb

input:

982 853189715
723570917 965086379 937217663 877612742 376593827 208527221 250409349 627695358 219260346 98102870 622057090 146454365 180031424 415096098 532943871 492131696 82340480 431203528 424805851 256707574 842877556 607064367 971320257 197733429 225165505 405723916 151762792 19896379 790679002...

output:

544386726

result:

ok "544386726"

Test #27:

score: 0
Accepted
time: 3ms
memory: 3852kb

input:

967 1909276738
599028172 964254438 324665314 953879462 90386901 653597935 16400205 807064286 461932313 515713577 835203363 436436811 497091022 126341888 894071176 389327017 676979275 14538376 32319775 15023782 62913342 736589445 279534945 963076983 692175531 86509067 565258719 976590564 626554897 15...

output:

357737423

result:

ok "357737423"

Test #28:

score: 0
Accepted
time: 3ms
memory: 3704kb

input:

944 583017422
474485427 963422497 859596613 30146182 804179975 98668649 782391061 133916861 704604280 80807933 900865988 726419257 814150620 985071325 107714832 286522338 419101719 745356871 787317347 625856343 430432775 866114524 587749633 580936888 11701908 914777867 831270999 933284749 314947143 ...

output:

104969714

result:

ok "104969714"

Test #29:

score: 0
Accepted
time: 3ms
memory: 3804kb

input:

966 1419020255
349942682 962590556 247044264 106412902 370489401 691223011 400898269 313285788 947276247 498418640 114012261 16401703 131210218 843800763 468842137 183717659 13740514 476175366 542314919 384172552 797952209 995639603 43447969 198796794 478711933 595563018 97283279 889978934 150823038...

output:

191526560

result:

ok "191526560"

Test #30:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

937 28727278
225399937 961758615 634491915 182679622 84282475 136293725 166889124 492654715 189948214 916029348 179674886 306384149 448269816 555046552 829969441 80912980 755862957 59510213 149828842 142488760 165471642 125164682 351662657 816656699 945721958 276348169 510779206 846673120 986698933 ...

output:

2

result:

ok "2"

Test #31:

score: 0
Accepted
time: 3ms
memory: 3840kb

input:

972 1593462784
100857193 960926673 21939566 258946342 798075549 581364439 932879980 819507290 432620180 333640055 245337511 596366594 765329414 413775990 191096746 125591950 497985401 790328708 904826414 753321321 532991076 254689760 659877345 434516605 412731983 957133321 776791486 803367305 675091...

output:

12821673

result:

ok "12821673"

Test #32:

score: 0
Accepted
time: 0ms
memory: 3924kb

input:

902 840152080
123798096 960094732 556870865 335213062 364384975 26435153 551387188 998876217 675292147 898734411 458483784 886349040 82389012 125021779 552224050 22787271 92624196 521147204 659823986 511637530 900510509 384214839 115575682 52376510 879742008 637918472 42803765 760061490 510967075 35...

output:

290207909

result:

ok "290207909"

Test #33:

score: 0
Accepted
time: 74ms
memory: 9888kb

input:

99981 383768740
237478326 322155407 930205508 175719580 46601058 72194070 539064593 171732827 31512372 839584010 736436026 831898546 174986629 492779329 927429376 418061443 998737915 494032461 573397444 142213421 773140630 33036917 59337299 266923244 210685670 593110757 777225043 968678142 576736689...

output:

645574592

result:

ok "645574592"

Test #34:

score: 0
Accepted
time: 47ms
memory: 10004kb

input:

99961 74244242
112935581 321323466 317653159 251986300 760394132 664748432 157571801 498585402 274184339 257194717 949582299 121880991 492046227 351508767 288556680 315256764 593376710 224850956 328395016 900529630 140660063 162561995 367551987 32266798 677695695 273895908 43237322 925372327 2651289...

output:

903323650

result:

ok "903323650"

Test #35:

score: 0
Accepted
time: 80ms
memory: 9884kb

input:

99912 1351217021
135876485 320491525 852584458 328253020 474187206 109819146 923562657 677954329 516856306 674805425 15244924 264379789 809105825 62754556 649683985 212452085 335499153 955669452 83392588 658845838 360695849 292087074 675766675 650126703 144705720 954681060 456733250 882066513 101004...

output:

107053777

result:

ok "107053777"

Test #36:

score: 0
Accepted
time: 89ms
memory: 10004kb

input:

99939 1031361422
11333740 319659583 240032109 404519739 40496632 554889860 689553513 4806905 759528272 92416132 80907549 554362235 126165423 921483993 10811289 109647406 77621597 539004299 690906511 269678399 728215282 421612153 131465011 267986609 464232097 635466211 722745530 838760698 936880725 5...

output:

756974237

result:

ok "756974237"

Test #37:

score: 0
Accepted
time: 64ms
memory: 10100kb

input:

99949 376289183
886790995 318827642 627479760 480786459 754289706 147444222 308060721 184175832 2200239 657510488 294053822 844344681 443225021 780213431 224454946 6842727 672260392 269822794 445904083 27994608 95734716 551137232 439679699 885846514 931242122 316251362 136241457 795454883 625272972 ...

output:

762184396

result:

ok "762184396"

Test #38:

score: 0
Accepted
time: 86ms
memory: 10016kb

input:

99904 1224809391
762248250 317995701 14927411 557053179 468082779 592514936 74051577 363544759 97388558 75121195 359716447 134327127 760284619 491459220 585582250 904038049 414382836 641289 53418007 786310816 463254149 680662310 747894388 503706420 398252147 144520162 402253737 752149069 461148867 9...

output:

902010674

result:

ok "902010674"

Test #39:

score: 0
Accepted
time: 54ms
memory: 9960kb

input:

99999 330137664
637705505 317163760 549858710 633319899 34392205 37585650 840042432 690397334 340060525 492731903 572862720 424309572 77344217 350188658 946709555 801233370 9021631 583976136 808415579 397143377 830773583 810187389 56109076 121566325 865262173 825305313 668266016 708843254 149541114 ...

output:

932661618

result:

ok "932661618"

Test #40:

score: 0
Accepted
time: 70ms
memory: 9956kb

input:

99985 1850022960
513162760 316331819 937306361 709586619 748185279 482656364 458549640 869766261 582732492 57826258 638525345 714292018 246920167 61434447 307836859 698428691 751144074 314794632 563413150 155459586 50809368 939712468 511807412 886909879 184788550 506090464 81761944 665537439 9854170...

output:

567106457

result:

ok "567106457"

Test #41:

score: 0
Accepted
time: 83ms
memory: 10016kb

input:

99964 980924447
388620015 315499878 324754012 785853339 461978353 75210726 224540496 49135188 825404459 475436965 851671618 4274464 563979765 920163884 668964164 595624012 493266518 45613127 170927074 913775794 418328802 69237546 820022100 504769784 651798575 186875616 347774223 622231625 821292903 ...

output:

183801686

result:

ok "183801686"

Test #42:

score: 0
Accepted
time: 73ms
memory: 10012kb

input:

99969 1780700175
264077270 314667937 859685311 862120059 28287779 520281440 990531352 375987763 68076426 893047673 917334243 146773262 881039363 778893322 30091469 492819333 87905313 628947974 925924646 524608355 785848235 51278977 128236788 122629690 118808600 867660767 613786503 578925810 50968515...

output:

645659292

result:

ok "645659292"

Test #43:

score: 0
Accepted
time: 54ms
memory: 10108kb

input:

99951 102625278
139534526 313835996 247132962 938386779 742080853 965352154 609038560 555356690 310748393 310658380 130480516 436755708 198098961 490139111 243735125 390014655 830027756 359766469 680922218 282924564 153367669 180804056 583935124 740489595 585818625 548445919 27282430 535619995 34556...

output:

1681919

result:

ok "1681919"

Test #44:

score: 0
Accepted
time: 80ms
memory: 10108kb

input:

99956 1576170515
14991781 313004054 634580614 14653498 455873927 410422868 375029416 882209266 553420360 875752736 196143141 726738153 515158559 348868549 604862430 287209976 572150200 90584964 288436141 41240772 520887102 310329134 892149813 358349501 52828650 229231070 293294710 492314181 33953292...

output:

23672762

result:

ok "23672762"

Test #45:

score: 0
Accepted
time: 82ms
memory: 9952kb

input:

99986 835442723
890449036 312172113 22028265 90920218 22183353 2977230 141020272 61578193 796092326 293363443 261805766 16720599 832218157 60114338 965989734 184405297 166788995 673919812 43433713 652073333 888406535 439854213 200364501 123693054 372355027 57499869 559306990 449008366 869829187 1408...

output:

429369468

result:

ok "429369468"

Test #46:

score: 0
Accepted
time: 72ms
memory: 10020kb

input:

99931 630733876
765906291 311340172 556959564 19703290 735976427 448047943 759527480 240947120 38764293 710974151 474952039 306703045 1794107 918843775 327117039 81600618 908911438 404738307 798431285 410389542 108442321 569379292 656062837 741552959 839365053 738285021 972802917 405702551 705705082...

output:

113862

result:

ok "113862"

Test #47:

score: 0
Accepted
time: 80ms
memory: 10012kb

input:

99904 1303093316
641363546 310508231 944407215 95970010 449769501 893118657 525518336 567799695 133952612 128584858 540614664 596685491 318853705 777573213 688244343 126279587 651033882 135556802 405945208 21222102 475961754 698904371 964277525 359412865 306375078 419070172 238815197 362396736 39409...

output:

754493933

result:

ok "754493933"

Test #48:

score: 0
Accepted
time: 58ms
memory: 9956kb

input:

99978 163775573
516820801 309676290 331854866 172236730 16078927 338189371 144025544 747168622 376624579 693679214 753760937 886667937 635913303 488819002 49371648 23474908 245672677 718891649 160942780 779538311 843481188 828429449 272492213 977272770 773385103 99855323 504827476 319090922 22997322...

output:

26845342

result:

ok "26845342"

Test #49:

score: 0
Accepted
time: 76ms
memory: 10012kb

input:

99953 1540134811
392278056 308844349 866786165 248503450 729872001 930743733 910016400 74021197 619296546 111289921 819423562 29166734 952972901 347548440 263015304 920670230 987795120 449710145 915940352 537854520 211000621 957954528 728190549 595132676 92911480 780640475 918323404 275785107 658491...

output:

990218938

result:

ok "990218938"

Test #50:

score: 0
Accepted
time: 86ms
memory: 9884kb

input:

99936 1322988426
267735312 308012408 254233816 324770170 443665075 375814447 676007255 253390124 861968513 528900629 32569835 319149180 270032498 58794229 624142609 817865551 729917564 33044992 523454276 148687081 578520055 87479607 36405238 212992581 559921505 461425626 184335683 232479292 75424136...

output:

21205567

result:

ok "21205567"

Test #51:

score: 0
Accepted
time: 43ms
memory: 10020kb

input:

99950 109001593
143192567 307180467 641681467 401036890 9974501 820885161 294514463 432759051 104640480 93994984 98232460 609131626 587092096 917523667 985269913 715060872 324556359 763863487 278451847 907003289 946039488 217004685 344619926 978336135 26931530 142210777 450347963 189173478 590117260...

output:

461097384

result:

ok "461097384"

Test #52:

score: 0
Accepted
time: 49ms
memory: 10028kb

input:

99905 42298217
18649822 306348526 29129118 477303610 723767575 265955875 60505319 759611627 347312447 511605691 163895085 899114072 904151694 776253104 346397218 612256193 66678802 494681982 33449419 665319498 166075274 346529764 800318262 596196040 493941555 970479577 863843891 145867663 278509507 ...

output:

193608181

result:

ok "193608181"

Test #53:

score: 0
Accepted
time: 82ms
memory: 10060kb

input:

99975 99976
68507 88691 64840 78737 77265 31725 40448 77267 52242 37642 5127 95889 7427 60315 82930 21027 33229 82829 28459 30958 57537 39286 5074 47589 72690 80427 7590 72563 24285 32226 42891 6448 51659 22288 24354 3670 95779 39293 79178 25391 31951 11697 30393 99319 44171 28027 64362 51326 18359 ...

output:

506686434

result:

ok "506686434"

Test #54:

score: 0
Accepted
time: 78ms
memory: 10024kb

input:

99958 99959
5781 80810 49077 50960 87858 42728 88361 89425 43501 63437 11981 56927 93144 76824 36579 59136 63256 81462 3201 36401 46996 48358 62384 6540 76103 78507 59601 34420 64397 83127 69807 21312 71449 16596 27071 58784 88122 51114 77324 85425 81133 7019 64789 92705 31072 72858 69669 76508 1188...

output:

306697436

result:

ok "306697436"

Test #55:

score: 0
Accepted
time: 77ms
memory: 9940kb

input:

99917 99918
33582 21846 42699 70038 93808 89043 61022 37639 70809 4593 69610 83556 58213 31211 77118 20667 91806 64320 31801 56925 45944 31217 49451 96003 24380 47017 78698 72696 52914 4716 27613 48060 57032 64661 74999 88171 52628 48559 70717 66598 46703 83752 84506 39945 1532 91558 53155 331 4925 ...

output:

299595848

result:

ok "299595848"

Test #56:

score: 0
Accepted
time: 81ms
memory: 9884kb

input:

99911 99912
67978 47374 7551 24491 88477 53964 96378 46625 66886 55004 8634 22165 65771 9244 73082 24465 90114 92552 42823 8527 55344 4278 75928 90865 68116 52686 56582 50347 85259 96630 12724 71231 16243 92382 59177 19655 26404 39593 6412 61832 78057 53206 80324 79666 50427 27083 91610 97918 40737 ...

output:

484686701

result:

ok "484686701"

Test #57:

score: 0
Accepted
time: 76ms
memory: 9892kb

input:

99958 99959
21336 51522 92830 98256 61922 48690 37303 27519 4288 66025 32266 85497 32385 99414 13789 61956 92753 8213 64519 29796 86984 3187 15643 36902 77496 84134 26518 63344 75596 30697 56343 45190 77669 72238 88845 8617 97259 52098 72979 59702 73305 72421 62453 74300 20494 87192 23407 69306 7236...

output:

212485846

result:

ok "212485846"

Test #58:

score: 0
Accepted
time: 70ms
memory: 10056kb

input:

99957 99958
92442 75840 26820 7852 7475 26967 14641 43887 20539 58211 17876 34947 54591 23619 18093 34067 51822 98322 54723 27515 99826 92422 31316 22998 27666 17482 29916 16066 70014 6204 260 35691 66573 9547 53962 2911 5876 25012 40905 60805 39554 51010 12484 98801 85478 25797 37704 3900 77401 739...

output:

502807727

result:

ok "502807727"

Test #59:

score: 0
Accepted
time: 85ms
memory: 9948kb

input:

99933 99934
16815 49593 94050 70680 2438 41632 58737 38500 18399 10790 1445 49752 4082 58965 47761 89989 45129 57618 71843 11184 3218 63184 36031 54585 18644 28176 30960 71925 20520 91492 30374 39386 2697 93939 94630 17943 68101 99125 75718 72006 12237 32709 67559 67668 12120 9718 50652 29516 69417 ...

output:

510243634

result:

ok "510243634"

Test #60:

score: 0
Accepted
time: 75ms
memory: 10004kb

input:

99990 99991
5106 42503 49072 55941 13637 50329 75028 71032 2062 783 17550 81599 16425 41939 29682 77111 14392 36613 98835 33836 10161 71124 64108 71067 29732 29711 18347 85042 87894 78398 72934 96728 84818 88440 1094 77770 61021 73065 28322 61904 68982 31832 79768 90558 43974 17165 22432 80413 19968...

output:

589981140

result:

ok "589981140"

Test #61:

score: 0
Accepted
time: 75ms
memory: 10016kb

input:

99999 100000
24299 54797 84880 60132 27312 24112 7978 90663 79026 58927 99473 22759 9129 99925 49469 50880 2060 32413 4791 24583 87008 97168 16348 29021 58819 37991 35722 38112 90960 23003 44473 86435 76291 59118 9959 7779 12 90160 18736 32199 58324 76968 24562 96357 40487 65855 99868 68514 73219 30...

output:

732339361

result:

ok "732339361"

Test #62:

score: 0
Accepted
time: 84ms
memory: 10008kb

input:

99901 99902
93697 61308 72778 669 14434 296 35052 11746 22830 62382 98986 71427 52120 17193 71782 53704 66860 36958 16115 46281 60195 78520 46296 51532 94160 30122 64825 39436 5833 836 70874 91056 75847 7950 38489 94146 75686 54131 82558 6204 27207 26917 1480 73736 20694 82984 81546 61119 33023 6783...

output:

976769384

result:

ok "976769384"

Test #63:

score: -100
Wrong Answer
time: 69ms
memory: 10096kb

input:

99991 1000000045
1000000000 100000006 500000044 300000030 700000000 700000000 600000035 600000035 199999925 800000022 199999925 1000000000 400000056 300000030 300000030 400000056 700000000 100000006 700000000 400000056 500000044 1000000000 600000035 800000022 1000000000 199999925 600000035 600000035...

output:

897861348

result:

wrong answer 1st words differ - expected: '340458129', found: '897861348'