QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#104713#3041. Dead Cacti SocietyArraiterTL 355ms14520kbC++176.2kb2023-05-11 19:29:402023-05-11 19:29:44

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 5532kb

input:

3 3
1 2 3
3 1 2 3
1 2 1 2
2 3 3 1

output:

10

result:

ok answer is '10'

Test #2:

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

input:

5 6
1 2 3 4 5
1 2 6 1
1 3 5 4
2 3 4 2
1 4 3 6
1 5 2 3
4 5 1 5

output:

22

result:

ok answer is '22'

Test #3:

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

input:

10 11
648052322 565910647 660564399 692596305 919489008 212738520 617650098 677929920 808272788 791544831
10 8 425278193 551233171
4 10 947118708 675103129
6 3 843388555 979992603
2 7 89886505 298201903
6 9 596198105 80916490
1 6 607631290 761815117
1 5 727447345 664950926
4 1 416196154 17044633
2 4...

output:

4595167732

result:

ok answer is '4595167732'

Test #4:

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

input:

20 22
586027983 17626209 143089294 541063189 497266584 815531025 654472332 628305267 18777925 293631001 470245328 474349257 573662223 270526587 592273876 185008021 1753288 948699612 550397057 97390149
14 4 611644452 347910227
18 11 123114412 83716498
17 1 146068364 531802823
17 15 636910057 98773334...

output:

3974997198

result:

ok answer is '3974997198'

Test #5:

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

input:

20 22
83084779 123479070 425691499 255394401 125997543 920540786 201955937 945957738 254445790 568943703 500445883 327469615 874058013 644798455 477406417 521195348 468735946 923014331 675264083 113306608
9 18 35113807 965823918
19 7 579456290 232691941
10 1 917347936 658306553
8 2 58554231 26540606...

output:

6805282780

result:

ok answer is '6805282780'

Test #6:

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

input:

30 36
247525284 97674171 26852067 487010457 727929235 636987006 760946911 203385779 977415036 698821707 654961883 595288085 922370605 822983963 918997277 395083501 613607654 891617614 42445125 949747778 705274768 793806862 287472495 56044216 487997282 212507107 636523584 361944482 96922580 114436867...

output:

5644748866

result:

ok answer is '5644748866'

Test #7:

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

input:

40 48
750854831 471076290 587955727 498095394 786098053 825167545 179457243 829214029 797076810 710708422 293783554 777448279 902548779 327282136 18961111 34892803 900322755 272536057 207671630 790893788 937146089 367828234 297451611 597092025 401816497 123546714 370985631 442309657 241530494 670889...

output:

7521819716

result:

ok answer is '7521819716'

Test #8:

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

input:

60 70
504908017 500966899 405923079 361072564 767784887 946807327 588131654 949996368 795680905 150901980 363765972 24071027 945511686 168188504 956076858 942308497 24820353 470313508 719738974 762887852 549969912 579755773 62063921 828996712 826911990 784586331 853936727 423204438 847895099 8352365...

output:

7671558503

result:

ok answer is '7671558503'

Test #9:

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

input:

100 116
709859759 353642926 643199303 853426969 479322816 444064693 352827637 664302815 313185142 186975627 722681439 250133519 718839115 417346925 828935934 733633457 522385113 477229174 263560950 491959746 943503975 665316099 106727481 85978050 24016214 676654179 639296754 907064206 984998429 5216...

output:

11980434803

result:

ok answer is '11980434803'

Test #10:

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

input:

120 145
2635622 630993960 536599776 875593862 288845548 402004552 422513936 706800694 632768700 305689110 793642514 959905494 609112156 356608637 997538411 419315814 440152871 504921772 394090004 690342165 377990323 437858253 808979334 688991180 543459694 866127727 195798129 33544112 41860213 405404...

output:

11602034888

result:

ok answer is '11602034888'

Test #11:

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

input:

200 230
455093388 862046443 844762059 237644815 247538374 787691789 483060374 864522919 361021277 373237865 213009352 597144750 571871835 125250895 479447977 765061959 360456436 862028881 478399532 744407821 135724934 377878100 810345448 270534292 492035382 922708327 219160562 7269065 92191573 77190...

output:

15227135836

result:

ok answer is '15227135836'

Test #12:

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

input:

300 355
205420793 14744060 153612302 790864976 539525202 567920940 232313247 282480949 46721177 446884846 268187580 17778034 588738571 485418318 17954743 306433388 734520184 652664326 741319611 255027117 71697306 780396224 98702154 103883036 299072426 975624476 688996738 124531878 887608592 19881554...

output:

28288584556

result:

ok answer is '28288584556'

Test #13:

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

input:

300 354
870833340 36218712 871509192 756192538 540093068 710013783 305554332 445850736 219178563 866769559 258150937 826956186 605285341 371673829 853577218 868463162 390910062 917592208 185072037 471834701 364632288 92416713 335001291 464762239 388946090 736766302 675835340 882004733 109686463 9855...

output:

18067009894

result:

ok answer is '18067009894'

Test #14:

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

input:

500 598
318238298 454564113 229456830 874542201 323702502 589826453 138046120 700423252 669327704 149936936 996296056 714750884 835565359 747379851 936076600 685303899 339777339 313384416 551281216 212209487 591447705 830900949 959826169 478300030 273570556 201014741 362118355 780969224 680079836 40...

output:

28910648446

result:

ok answer is '28910648446'

Test #15:

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

input:

500 621
783326377 213057346 452463223 614175264 39015465 560022863 811804236 385620298 229517580 397865390 677994992 506170152 703185152 373321078 154953230 466854251 260634678 420879277 786082561 585440069 253611333 956057271 99785811 668947719 870902830 905481174 983432542 730406352 313533507 5421...

output:

36482283590

result:

ok answer is '36482283590'

Test #16:

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

input:

500 636
724190899 727675986 925314810 682445087 809175927 727293335 323958381 12589676 252670890 252902468 558864941 858642132 533119647 305832543 449285133 891277048 658769120 849338796 260579624 402340218 688394733 629064437 870483269 504585525 160743954 836099510 188874907 411899540 208959114 276...

output:

28267060394

result:

ok answer is '28267060394'

Test #17:

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

input:

600 765
331390397 234359711 132566966 893634969 848544647 710578748 391352681 899453186 603591471 122561878 660655642 730227533 670527059 805646590 634686960 879962266 141865351 540609097 557934833 849710347 574726732 238841768 864125549 167345767 638342321 355645845 860566943 977379951 253130001 80...

output:

42054334478

result:

ok answer is '42054334478'

Test #18:

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

input:

800 1018
59081642 348584180 296202284 313624928 259897630 392891006 981735221 905059221 106790874 846540783 949345562 255824568 432421584 747513334 92045663 421623268 718803047 276692570 84246438 896337042 541163458 719763994 531530778 519367709 897401443 80220420 299672485 720615837 450431357 14088...

output:

35165578401

result:

ok answer is '35165578401'

Test #19:

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

input:

1000 1267
877140180 266122375 706134489 916591677 61975578 825050386 453772684 809089173 696818055 925973910 58665991 599361303 98232752 657638059 681571765 164740866 213230165 16214206 811487438 244271441 556035092 239449544 443914037 728721059 874973724 698868475 706407317 907165174 106384360 6183...

output:

28482503085

result:

ok answer is '28482503085'

Test #20:

score: 0
Accepted
time: 6ms
memory: 5624kb

input:

1000 1272
372555876 403321835 79063907 601401165 523989537 848924467 720822774 914662640 910131046 481402873 93621598 477097477 767940122 818634724 127981647 694563409 996845440 670016716 214437642 673363788 143491085 51881335 169409707 197903896 629040074 704934095 443607964 337480876 461088734 887...

output:

50364153098

result:

ok answer is '50364153098'

Test #21:

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

input:

1000 1291
862066834 78007885 703327451 485019651 956699515 232659135 192950300 253011899 709050910 601440995 992595072 427790021 571324497 688840948 514622522 581933259 491379379 713357791 342366256 970817739 431379927 873045433 410204223 786790215 924749292 925542960 793745070 438423198 257604642 9...

output:

36203669681

result:

ok answer is '36203669681'

Test #22:

score: 0
Accepted
time: 7ms
memory: 5600kb

input:

1000 1289
90991532 578710547 467904638 570857121 539736360 102249161 832342416 711213298 608926459 769011896 965504123 316557124 442755724 780313669 418022516 273062087 985651781 523776798 4142090 646124255 954338739 718637407 839777218 269173081 290032519 236465095 732065306 345494494 118483704 282...

output:

37160106273

result:

ok answer is '37160106273'

Test #23:

score: 0
Accepted
time: 24ms
memory: 6340kb

input:

5000 6472
802555890 344076849 850558052 701207117 15924654 702294749 42887889 288019072 93031569 137654948 234012247 583614111 892274436 282421078 73664326 353980844 814834494 103987621 969392504 843818557 326871053 660050631 515339166 138331554 931243331 729278058 868754132 821735913 457662142 3207...

output:

91889290921

result:

ok answer is '91889290921'

Test #24:

score: 0
Accepted
time: 24ms
memory: 6152kb

input:

5000 6469
705484409 242068759 730883171 311189127 66517574 452018423 834381337 921337319 268236679 574958425 833630501 352300848 673654892 31965836 332373623 617470003 964559604 475688615 209007584 236544510 646764707 93506146 724161834 755546750 587252930 798727859 235407652 461310743 222305589 307...

output:

87728878983

result:

ok answer is '87728878983'

Test #25:

score: 0
Accepted
time: 22ms
memory: 6324kb

input:

5000 6473
214708338 607808794 12300882 848974662 43449133 547026705 52442226 745084887 137741812 694874986 482642445 908815057 128814596 454209499 866139570 148759807 363276978 520603380 710760495 274761801 676098901 953538117 870098315 429820110 874228855 453187663 618977150 306320378 212565157 295...

output:

82645011657

result:

ok answer is '82645011657'

Test #26:

score: 0
Accepted
time: 38ms
memory: 6736kb

input:

10000 13136
957216862 958039656 605148747 42763931 481910417 613137640 606116114 36963352 806806956 686334064 122444048 851452167 370710544 487487136 866567994 419604300 918705054 347649256 603375414 400605847 795563530 394608135 861653540 952310390 768441825 212572486 616147557 924301365 388410934 ...

output:

125324304084

result:

ok answer is '125324304084'

Test #27:

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

input:

20000 26279
571030534 818956820 787801444 993326362 338766445 991822625 174326427 888028966 69588242 523897583 880911792 772382046 537709003 442699575 443429031 193849104 773844443 980515600 249328656 756280728 447169326 71279934 244351678 783062050 929663555 365914172 996499338 943723616 21760201 8...

output:

172888030173

result:

ok answer is '172888030173'

Test #28:

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

input:

20000 26314
736585103 344229872 944902397 249709278 187627636 243685619 513738625 720202212 147835558 400721879 957506687 907294719 196266210 84652248 250033327 436617590 388114890 216487645 172586895 472017920 179514181 920721510 973973487 59917027 735241893 57172066 183799568 379766325 169568311 9...

output:

214461632080

result:

ok answer is '214461632080'

Test #29:

score: 0
Accepted
time: 175ms
memory: 10248kb

input:

40000 52483
967798374 538279988 219581495 216424720 63755749 951998850 919899238 416464082 192721027 609672175 771556079 796525720 698280933 767129292 56277617 538193314 330009158 650205413 939065567 384177221 128864940 646344353 534820979 516660924 224852424 712773568 788574185 442985901 856012575 ...

output:

284010942884

result:

ok answer is '284010942884'

Test #30:

score: 0
Accepted
time: 169ms
memory: 10276kb

input:

40000 52532
700486213 599181470 974553530 963963628 921242757 906500304 592001925 364139032 215216333 574431003 650938195 604433301 60334130 296644541 757960099 956066502 823081242 824961804 303724192 235175585 973899490 375883837 922338417 915321398 401149180 180841419 247735306 178460126 906139468...

output:

253666204112

result:

ok answer is '253666204112'

Test #31:

score: 0
Accepted
time: 179ms
memory: 10356kb

input:

40000 52471
552909036 315582251 254483008 246582910 400997977 223365964 707004685 599820923 128627117 374896314 749290997 906508864 524916438 414505554 513285572 466805532 734101075 632506306 740559242 55769461 851008243 894923480 137225856 90131578 74953270 761755052 690210997 492129237 927559594 2...

output:

203486790627

result:

ok answer is '203486790627'

Test #32:

score: 0
Accepted
time: 274ms
memory: 12612kb

input:

60000 78806
39614254 708374143 826344894 782874540 396219260 720713784 530720274 871890677 652402522 21030758 510196492 1874513 491145194 765818081 969222824 430563173 837819349 285520846 146852348 238986816 613923061 291576535 772267703 79958266 938025421 320680846 299577952 180676577 153320112 751...

output:

328633572809

result:

ok answer is '328633572809'

Test #33:

score: 0
Accepted
time: 274ms
memory: 12760kb

input:

60000 78961
761734040 303595317 252967996 332743251 88847198 427720365 979284665 331561287 913418664 505289535 105582322 583681352 859697232 675635341 160381500 786990956 637267701 29529057 746646805 834566045 244785489 220303758 125908344 158272159 544431521 896976836 650558313 966373885 272993239 ...

output:

347351893610

result:

ok answer is '347351893610'

Test #34:

score: 0
Accepted
time: 349ms
memory: 14460kb

input:

75000 98540
832071305 592274299 841026066 592745286 120927986 972638433 107669863 871546038 887629498 699021115 880832821 88506304 369118740 690914693 216146029 844054478 475876304 461457528 74622699 796495675 622632506 808572846 596078447 104146783 309102026 168922993 114862158 112456641 650249115 ...

output:

285460796068

result:

ok answer is '285460796068'

Test #35:

score: 0
Accepted
time: 355ms
memory: 14520kb

input:

75000 98529
875485626 37284699 81161516 894926741 749373743 811280382 11296021 553361109 244893312 973457449 322574323 50915148 43074216 997463385 647228108 532285800 722239617 993369435 824114685 949641403 606614020 164714041 837291293 971530305 894628214 849648387 622072724 814981607 266612550 827...

output:

378270984832

result:

ok answer is '378270984832'

Test #36:

score: -100
Time Limit Exceeded

input:

100000 131472
602763809 727636855 380014755 112374420 71564621 83259795 420049740 884559109 211696965 257386268 380384806 717903632 451479223 467489991 116134738 847071012 227666506 261967912 537311511 924845008 967758006 927156011 260051621 920553708 874025619 275468647 984471352 171154097 24093950...

output:


result: