QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#234210#3502. Sightseeing in KyotoGMBox100 ✓15ms6356kbC++201.8kb2023-11-01 14:49:502023-11-01 14:49:51

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 0ms
memory: 3536kb

input:

55 985
972919143 571703632 545299240 122906268 313605426 768197556 821161013 810382136 607096032 550926769 636584830 233641411 664075312 999513344 919939491 226167158 374405025 792842315 461126245 212582686 538315759 397667313 770583715 411616307 363120565 690544971 780156662 507283838 215368652 461...

output:

144700753486

result:

ok single line: '144700753486'

Test #2:

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

input:

489 2
972249103 697236949 967250764 681884473 636477380 692387561 796114900 896503411 763037576 531113684 822189792 807721830 379742704 846345706 410827375 402701704 288551124 936639599 375887198 452684376 312984818 244195135 486887067 586097199 539831363 306788937 900402922 677824462 416376869 3759...

output:

328323599204

result:

ok single line: '328323599204'

Test #3:

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

input:

323 8
945461002 972239828 497762984 785301370 848811267 781893207 883500216 606146710 897537367 693757813 773725023 641896522 644191887 883063599 971678650 612626656 627975243 513682284 958238083 481331187 448598476 690397378 810919101 466228458 520809215 642288505 459053386 425488261 729532078 5456...

output:

131909604852

result:

ok single line: '131909604852'

Test #4:

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

input:

211 6
300121025 10610632 642793775 820473527 52357847 790030800 930189727 478683824 604076353 442883453 868963075 458740167 956375465 402424884 523031876 526153589 125251913 93824897 767836934 456717799 932696378 585279523 565442853 533089757 384029723 733772180 715451948 677398582 104677992 1442538...

output:

24939943080

result:

ok single line: '24939943080'

Test #5:

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

input:

7 8
324438357 888585680 228658980 633680643 553949653 919446743 26789616
733732803 467151303 946129278 774855331 974783731 656427372 391841553 441397515

output:

3288083871

result:

ok single line: '3288083871'

Test #6:

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

input:

1000 1000
974951229 572812767 61715338 58251108 992970132 292320832 346580154 883002624 576964058 294430934 705885668 17573757 290787136 184748452 110588470 132698209 364284483 39793402 636955202 414014896 895716291 779502490 194065320 111799307 938923636 424807575 673188421 208882345 776527514 4149...

output:

8615286430

result:

ok single line: '8615286430'

Test #7:

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

input:

1000 1000
463735528 368326134 677560869 451081556 375842266 6384404 536728283 244288194 174615742 832350611 90313025 745365715 317800980 757018742 59003470 726586504 81229973 820301929 811995855 239454819 222869219 493887906 769117768 552617574 531399848 885949545 902075394 979715180 256501297 45972...

output:

4777185504

result:

ok single line: '4777185504'

Test #8:

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

input:

1000 1000
883558431 945024329 580084906 610495543 886627709 672002744 741096827 470027044 470962281 937891177 847981533 824554158 602335507 876759099 523261283 694326120 436583501 535422997 890070814 954622521 949644535 824717715 640832038 921176755 926409841 980396946 498467817 837955947 770709901 ...

output:

340059299828

result:

ok single line: '340059299828'

Test #9:

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

input:

1000 1000
592192250 845606062 666956702 816157461 468366449 559442281 532323468 464683110 706681121 797732795 733235302 392399774 447221439 492764524 792592254 708344621 609221277 466203011 975765420 657923730 751157743 621708893 455014240 952187591 329055055 718233689 630169159 765083206 604898721 ...

output:

154219020675

result:

ok single line: '154219020675'

Test #10:

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

input:

1000 1000
1000000000 994038761 988095344 982169748 976261973 970372020 964499888 958645578 952809088 946990421 941189574 935406549 929641345 923893963 918164401 912452662 906758743 901082646 895424370 889783916 884161283 878556471 872969481 867400312 861848964 856315437 850799732 845301849 839821786...

output:

352472454089

result:

ok single line: '352472454089'

Test #11:

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

input:

1000 1000
771979348 809794477 694390926 730828708 688658574 954342515 949737702 941901614 601396413 891027684 669526674 505558540 795612501 827513438 805528270 497846784 950599319 750972320 702762085 749933401 496071148 638780364 687373272 785163707 946347808 889047474 839522833 574600817 549625195 ...

output:

210598139296

result:

ok single line: '210598139296'

Test #12:

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

input:

1000 1000
678671204 736484989 636124998 765249579 785794536 766786747 687676825 994297449 588604670 915236809 883080964 866171198 716853010 916987426 761166983 861663197 988771987 811184042 677468802 547964352 770770731 968682653 861745977 903477157 864524565 568472674 890799039 692561891 487676830 ...

output:

184261835444

result:

ok single line: '184261835444'

Test #13:

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

input:

1000 1000
1000000000 995348837 990697674 986046511 981395348 976744186 972093023 967441860 962790697 958139534 953488372 948837209 944186046 939534883 934883720 930232558 925581395 920930232 916279069 911627907 906976744 902325581 897674418 893023255 888372093 883720930 879069767 874418604 869767441...

output:

625000001373

result:

ok single line: '625000001373'

Test #14:

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

input:

1000 1000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000...

output:

1998000000000

result:

ok single line: '1998000000000'

Subtask #2:

score: 30
Accepted

Test #15:

score: 30
Accepted
time: 0ms
memory: 3892kb

input:

307 1278
1000 991 983 975 967 959 952 944 936 928 920 913 905 897 889 882 874 867 859 852 844 837 829 822 815 808 800 793 786 779 772 764 757 750 743 736 730 723 716 709 702 695 689 682 675 669 662 655 649 642 636 630 623 617 610 604 598 592 585 579 573 567 561 555 549 543 537 531 525 519 514 508 50...

output:

277650

result:

ok single line: '277650'

Test #16:

score: 0
Accepted
time: 4ms
memory: 3848kb

input:

73984 7749
653 662 643 869 947 962 944 645 982 945 606 499 878 969 990 910 627 658 904 831 993 897 715 739 940 578 729 585 854 711 634 931 682 846 763 546 587 883 997 512 753 795 533 768 891 987 704 781 884 659 502 925 644 596 575 967 907 714 788 576 598 568 784 959 612 726 530 910 754 746 999 609 8...

output:

3853334

result:

ok single line: '3853334'

Test #17:

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

input:

126 75930
1000 921 846 774 705 640 578 518 462 410 360 314 271 231 194 160 130 103 79 58 40 26 15 7 2 1 1 1 1 2 3 4 5 7 9 10 13 15 17 20 23 26 29 33 37 40 45 49 53 58 63 68 73 79 85 90 97 103 109 116 123 130 137 145 152 160 168 177 185 194 203 212 221 231 240 250 260 271 281 292 303 314 325 337 348 ...

output:

197932

result:

ok single line: '197932'

Test #18:

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

input:

32784 12
871 147 880 18 991 126 865 615 605 633 457 52 756 435 318 857 362 460 130 861 720 339 201 562 834 853 378 652 742 669 371 909 341 318 92 127 535 112 722 388 654 862 443 687 859 600 118 566 700 531 715 194 442 539 905 353 613 558 132 811 342 710 746 138 585 932 399 11 489 861 656 137 911 933...

output:

2853516

result:

ok single line: '2853516'

Test #19:

score: 0
Accepted
time: 10ms
memory: 4456kb

input:

100000 100000
481 653 841 215 75 920 189 252 250 624 733 697 579 561 954 129 300 503 333 267 312 934 986 689 687 874 642 795 211 417 181 892 684 871 727 896 164 77 128 927 313 109 622 611 336 921 871 538 258 311 687 892 408 464 834 711 513 624 97 156 921 881 56 212 421 13 856 272 1 333 818 849 396 8...

output:

206470

result:

ok single line: '206470'

Test #20:

score: 0
Accepted
time: 10ms
memory: 4368kb

input:

100000 100000
279 297 599 861 394 613 447 183 733 686 42 294 245 975 381 201 850 772 501 629 500 314 575 10 397 401 926 194 220 484 820 366 16 66 451 574 546 993 993 918 137 716 144 892 305 248 234 704 775 689 46 925 754 889 427 956 706 318 825 41 984 706 984 248 421 421 699 730 951 231 480 544 400 ...

output:

207384

result:

ok single line: '207384'

Test #21:

score: 0
Accepted
time: 10ms
memory: 4364kb

input:

100000 100000
581 693 562 758 839 944 715 628 623 595 816 814 623 770 673 674 542 945 946 826 870 724 856 805 837 512 630 602 788 550 551 636 784 609 759 698 640 716 740 960 543 824 965 653 989 940 922 597 707 815 554 759 891 944 519 618 586 551 765 928 998 996 507 831 697 761 919 952 845 888 682 80...

output:

16781816

result:

ok single line: '16781816'

Test #22:

score: 0
Accepted
time: 10ms
memory: 4408kb

input:

100000 100000
629 659 881 805 903 835 862 528 835 970 659 879 921 721 961 984 680 675 781 996 646 961 970 517 809 845 726 960 575 604 867 551 719 671 963 780 964 892 836 782 996 882 932 848 646 905 569 509 541 612 754 626 634 787 725 570 686 787 932 936 914 624 791 600 625 522 913 832 868 990 843 92...

output:

18171753

result:

ok single line: '18171753'

Test #23:

score: 0
Accepted
time: 4ms
memory: 4408kb

input:

100000 100000
1000 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 9...

output:

66553767

result:

ok single line: '66553767'

Test #24:

score: 0
Accepted
time: 10ms
memory: 4444kb

input:

100000 100000
897 563 642 686 499 918 584 796 815 720 610 891 892 582 835 542 539 567 904 561 767 736 621 765 529 693 722 709 660 710 622 665 620 903 992 649 945 725 609 941 569 902 554 766 779 666 568 866 508 531 904 944 902 894 970 923 930 822 994 893 592 716 552 619 596 785 784 741 887 522 683 73...

output:

29059334

result:

ok single line: '29059334'

Test #25:

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

input:

100000 100000
776 547 926 751 631 750 624 907 679 560 700 721 820 988 580 733 572 742 954 535 733 951 894 991 647 683 604 746 947 607 736 799 514 855 840 846 769 602 743 896 843 573 548 913 896 842 690 991 776 694 771 938 599 852 868 538 841 927 703 634 635 765 837 757 656 676 654 959 959 979 774 61...

output:

32580184

result:

ok single line: '32580184'

Test #26:

score: 0
Accepted
time: 8ms
memory: 4460kb

input:

100000 100000
1000 998 997 996 995 994 993 992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 934 933 932 931 930 929 928 927 9...

output:

99226519

result:

ok single line: '99226519'

Test #27:

score: 0
Accepted
time: 9ms
memory: 4392kb

input:

100000 100000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1...

output:

199998000

result:

ok single line: '199998000'

Test #28:

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

input:

2 2
943 460
257 623

output:

717

result:

ok single line: '717'

Test #29:

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

input:

2 3
213 562
705 42 69

output:

495

result:

ok single line: '495'

Test #30:

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

input:

3 2
4 787 132
217 830

output:

566

result:

ok single line: '566'

Test #31:

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

input:

5 2
621 818 614 372 775
996 527

output:

2729

result:

ok single line: '2729'

Test #32:

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

input:

2 9
440 438
963 286 600 965 71 632 115 810 923

output:

3583

result:

ok single line: '3583'

Test #33:

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

input:

6 5
458 127 174 414 874 919
828 702 139 835 549

output:

3189

result:

ok single line: '3189'

Test #34:

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

input:

9 5
943 334 271 14 893 872 964 30 965
270 102 56 432 466

output:

1572

result:

ok single line: '1572'

Test #35:

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

input:

6 8
770 278 753 735 514 696
333 511 256 214 609 359 833 659

output:

4487

result:

ok single line: '4487'

Test #36:

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

input:

8 6
369 308 180 278 813 292 109 376
48 869 945 644 1000 21

output:

854

result:

ok single line: '854'

Test #37:

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

input:

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

output:

15

result:

ok single line: '15'

Test #38:

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

input:

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

output:

15

result:

ok single line: '15'

Subtask #3:

score: 60
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #39:

score: 60
Accepted
time: 7ms
memory: 4004kb

input:

87783 542
954238523 916275823 583617019 340578486 283062029 966007941 875460561 617266429 269839396 287835379 699890510 982767030 970906180 750838925 425948298 471983341 291646204 429034504 981316734 627852913 385678013 34645581 894785577 322528363 316026104 908469901 704136940 213121981 785271820 6...

output:

706040588712

result:

ok single line: '706040588712'

Test #40:

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

input:

174 1136
566965797 723177832 970938384 98642891 519185573 940792419 529689624 86847364 716676165 289125544 878680044 548104044 641136609 815448185 687500045 676591956 730087580 384898503 65415553 591767517 338608451 114047971 389742003 628000636 256636407 581388490 864644136 950562247 298905688 4085...

output:

17127251735

result:

ok single line: '17127251735'

Test #41:

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

input:

8999 13
909549745 737220919 813721271 862442463 941087547 880906789 911011118 966232521 917863218 499866664 657404534 547896012 962347935 975040149 950532802 546680027 868772626 520321190 686362973 498173252 560425674 616580171 717744884 751252911 577348968 943324332 841081091 821881574 551955153 97...

output:

2771505753602

result:

ok single line: '2771505753602'

Test #42:

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

input:

19850 6947
704969086 599632292 646456805 933724612 518497991 618074752 966701585 750109689 968601746 821777358 624418801 973133417 534080994 664059051 550370539 998601905 810699838 509589112 642022281 976514353 724737410 665183087 858023961 969103081 883834153 616927255 992923485 875195116 930617579...

output:

3070300109847

result:

ok single line: '3070300109847'

Test #43:

score: 0
Accepted
time: 11ms
memory: 4392kb

input:

100000 100000
491043354 184213578 332968185 93269311 543140660 389946482 813073024 5472396 207127588 615159140 979443019 51788488 920638222 229356942 479315576 260666700 941729229 317650607 278921342 310120824 204109035 776983705 733213800 884657104 124117549 205596860 689099297 167618703 76942066 3...

output:

18596433246

result:

ok single line: '18596433246'

Test #44:

score: 0
Accepted
time: 10ms
memory: 4428kb

input:

100000 100000
808902712 650564034 726741288 633258757 955544211 763668735 288098975 419571818 444163685 536175917 38030916 10156618 586694170 433637957 631918083 988756933 741305394 752859352 249848157 755427929 540448584 792038654 363264091 165972087 570227602 481185225 898192329 825098816 31701012...

output:

22451521725

result:

ok single line: '22451521725'

Test #45:

score: 0
Accepted
time: 14ms
memory: 4428kb

input:

100000 100000
776720081 790493567 830632844 729039847 988379917 656702537 533761946 517365699 905142286 952158794 835130510 763627480 867036345 848658305 703598682 761137340 842813240 588418937 802424007 594841174 593497793 951872641 796211993 640653634 981652754 665487683 928053643 562250303 596030...

output:

21386303439248

result:

ok single line: '21386303439248'

Test #46:

score: 0
Accepted
time: 15ms
memory: 4384kb

input:

100000 100000
623697100 953767810 987114224 513117994 515312050 967190296 663542254 872790809 698563229 933101919 791982803 586451122 825813819 711663242 747184294 896467413 991668669 542148430 597277374 735852314 866225984 975801208 566347058 607037214 615474705 901516917 651250147 868644023 583126...

output:

27794289772175

result:

ok single line: '27794289772175'

Test #47:

score: 0
Accepted
time: 14ms
memory: 6356kb

input:

100000 100000
1000000000 998008960 996019904 994032832 992047745 990064641 988083522 986104387 984127236 982152069 980178886 978207687 976238472 974271241 972305995 970342732 968381454 966422159 964464849 962509523 960556181 958604823 956655449 954708060 952762654 950819233 948877795 946938342 94500...

output:

56102199916877

result:

ok single line: '56102199916877'

Test #48:

score: 0
Accepted
time: 10ms
memory: 4536kb

input:

100000 100000
903980076 547689807 566061481 928876098 693148940 652204154 608916207 917527029 555165793 591728815 613364322 516665836 838106745 855478004 618100203 703932982 890989493 799285763 949533936 839512417 607597571 600014410 764772704 538719921 954296796 680408487 504731291 737817590 982505...

output:

41698334872459

result:

ok single line: '41698334872459'

Test #49:

score: 0
Accepted
time: 14ms
memory: 4404kb

input:

100000 100000
888090503 621118790 654447848 827157576 622934277 991866013 824297873 550167549 765132050 698466895 746406489 575320885 975025112 639733027 708617178 790874819 609161134 657856274 803778091 677936742 527682449 602466489 623224283 629938417 744924093 581791812 699731764 887318888 752121...

output:

17158169504801

result:

ok single line: '17158169504801'

Test #50:

score: 0
Accepted
time: 13ms
memory: 4540kb

input:

100000 100000
1000000000 999982842 999965685 999948527 999931370 999914213 999897055 999879898 999862741 999845583 999828426 999811268 999794111 999776954 999759796 999742639 999725482 999708324 999691167 999674010 999656852 999639695 999622537 999605380 999588223 999571065 999553908 999536751 99951...

output:

93533000106465

result:

ok single line: '93533000106465'

Test #51:

score: 0
Accepted
time: 10ms
memory: 4448kb

input:

100000 100000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 ...

output:

199998000000000

result:

ok single line: '199998000000000'

Extra Test:

score: 0
Extra Test Passed