QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#618905#796. Global Warmingbradley 100 ✓46ms6528kbC++141.0kb2024-10-07 11:35:112024-10-07 11:35:11

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

10 10
1 1 1 1 1 1 2 2 2 1

output:

3

result:

ok single line: '3'

Test #2:

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

input:

8 4
1 2 3 4 3 4 5 8

output:

8

result:

ok single line: '8'

Test #3:

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

input:

7 1
1 2 3 1 2 6 7

output:

5

result:

ok single line: '5'

Test #4:

score: 5
Accepted
time: 0ms
memory: 4080kb

input:

8 4
1 2 3 4 7 8 9 8

output:

8

result:

ok single line: '8'

Test #5:

score: 5
Accepted
time: 0ms
memory: 3740kb

input:

8 2
1 2 3 10 11 6 7 8

output:

6

result:

ok single line: '6'

Test #6:

score: 5
Accepted
time: 0ms
memory: 3880kb

input:

5 2
1 2 5 8 10

output:

5

result:

ok single line: '5'

Test #7:

score: 5
Accepted
time: 0ms
memory: 4072kb

input:

3 2
1 2 1

output:

3

result:

ok single line: '3'

Test #8:

score: 5
Accepted
time: 0ms
memory: 3880kb

input:

5 0
3 2 1 2 1

output:

2

result:

ok single line: '2'

Test #9:

score: 5
Accepted
time: 0ms
memory: 3808kb

input:

8 10
1 2 3 4 1 2 3 4

output:

8

result:

ok single line: '8'

Test #10:

score: 5
Accepted
time: 0ms
memory: 3808kb

input:

5 10
1 12 3 14 5

output:

4

result:

ok single line: '4'

Test #11:

score: 5
Accepted
time: 1ms
memory: 5828kb

input:

10 10
1 2 3 1 2 3 30 4 5 6

output:

9

result:

ok single line: '9'

Subtask #2:

score: 10
Accepted

Dependency #1:

100%
Accepted

Test #12:

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

input:

50 15
10 9 8 7 1 3 6 7 1 8 2 2 8 8 2 10 1 10 9 4 9 2 5 6 2 2 4 7 7 4 4 7 7 9 6 5 8 7 7 4 8 9 6 6 10 1 3 2 8 4

output:

14

result:

ok single line: '14'

Test #13:

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

input:

50 0
8 1 7 1 10 6 5 1 8 2 4 8 2 5 2 10 10 4 8 3 4 5 3 3 4 1 8 9 3 10 8 2 3 3 3 5 8 7 10 7 6 10 8 7 7 8 7 10 6 5

output:

9

result:

ok single line: '9'

Test #14:

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

input:

50 50
48 8 25 5 76 40 86 32 50 31 27 30 85 31 32 2 99 39 100 91 40 16 24 39 73 54 93 27 53 37 82 7 19 27 45 14 72 96 43 21 98 84 71 12 30 54 20 67 93 87

output:

16

result:

ok single line: '16'

Test #15:

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

input:

50 20
1 5 8 9 14 14 18 18 19 20 20 21 26 26 29 34 34 34 35 36 39 42 52 52 53 55 59 59 60 62 64 66 69 71 71 72 74 74 76 82 84 86 86 90 90 91 92 94 95 99

output:

39

result:

ok single line: '39'

Test #16:

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

input:

50 20
5 2 6 3 13 3 13 2 20 2 21 2 22 1 25 2 33 3 42 3 46 2 51 3 60 3 64 2 64 3 64 1 68 2 68 2 73 3 85 3 85 2 89 2 90 3 91 3 94 2

output:

22

result:

ok single line: '22'

Test #17:

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

input:

10 4
1 2 3 1 2 3 30 4 5 6

output:

9

result:

ok single line: '9'

Test #18:

score: 10
Accepted
time: 1ms
memory: 5916kb

input:

20 3
4 2 6 4 8 6 10 8 12 10 14 12 16 14 18 16 20 18 22 20

output:

11

result:

ok single line: '11'

Subtask #3:

score: 13
Accepted

Dependency #2:

100%
Accepted

Test #19:

score: 13
Accepted
time: 1ms
memory: 3684kb

input:

1000 30000000
483078819 562775854 954008022 940224864 871725626 958025840 912680341 750527693 631624344 557095534 71757325 425667483 517216185 690573116 332767116 280990616 573440782 150442752 394290387 311942395 946249915 130680820 310056617 858299452 255210585 341680640 593275276 683626237 8896811...

output:

63

result:

ok single line: '63'

Test #20:

score: 13
Accepted
time: 1ms
memory: 3788kb

input:

1000 10000
798021065 795425625 361795545 672734437 724048117 32053443 194354897 270630990 818250679 897484651 92746168 643029034 132106220 12921571 270798863 123547789 871931135 49087295 68527443 380194025 253048644 902169996 347624914 329456522 204205552 993174461 837791801 490582816 879038277 2261...

output:

60

result:

ok single line: '60'

Test #21:

score: 13
Accepted
time: 1ms
memory: 3812kb

input:

1000 1000
293291502 772654930 309525091 429147065 90993902 846377737 116313393 378716205 336489733 277589041 883906274 858192443 440119979 912736175 678223236 953619334 128673926 712452719 599826461 257746889 593667577 378495337 52946709 202939167 183029066 867706805 12748245 103567710 688249069 458...

output:

58

result:

ok single line: '58'

Test #22:

score: 13
Accepted
time: 1ms
memory: 3796kb

input:

1000 0
678855005 114490965 398157981 674388380 883341032 443615922 724529332 424843248 1167455 314422735 164694261 578576777 308486909 5725097 901067204 448253488 728990311 114529296 26373467 489271629 381470552 24737000 243293210 619047814 643755971 38561119 44143414 636611629 95919528 886454478 10...

output:

61

result:

ok single line: '61'

Test #23:

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

input:

1000 100
682915 2 1707651 3 1707786 1 2240425 3 2803347 1 2875055 3 4295961 1 4906760 2 7214936 2 7390638 3 8312077 2 8542030 3 9543255 3 11576881 3 12622630 1 12669690 3 13960953 1 14640965 2 17567663 3 18979570 3 19107146 3 19289533 2 19711592 2 22520568 3 22632030 3 24240379 2 25576112 2 28849280...

output:

500

result:

ok single line: '500'

Test #24:

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

input:

1000 1000
1906652 3 3524896 3 5076190 1 5189571 3 7315132 2 8136472 3 8492112 3 8844539 2 9590758 1 9677740 1 10208913 3 12651743 1 13293593 1 13902407 1 14481798 2 14996100 2 15425807 3 16753280 2 19343820 2 20139063 3 20671893 3 21083762 2 21993331 1 22948957 1 23193877 3 23509929 3 24826375 3 252...

output:

500

result:

ok single line: '500'

Test #25:

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

input:

901 301
1 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:

900

result:

ok single line: '900'

Test #26:

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

input:

1000 100
101 2 103 4 105 6 107 8 109 10 111 12 113 14 115 16 117 18 119 20 121 22 123 24 125 26 127 28 129 30 131 32 133 34 135 36 137 38 139 40 141 42 143 44 145 46 147 48 149 50 151 52 153 54 155 56 157 58 159 60 161 62 163 64 165 66 167 68 169 70 171 72 173 74 175 76 177 78 179 80 181 82 183 84 1...

output:

501

result:

ok single line: '501'

Subtask #4:

score: 10
Accepted

Test #27:

score: 10
Accepted
time: 46ms
memory: 6136kb

input:

200000 0
414925422 830460469 203382186 23069480 903337156 841479272 869576219 179634316 278229637 238231547 157394749 281533987 663614680 427283998 859717890 974826721 54096963 65444180 39454645 352630431 831063613 96468855 296768732 810663659 270813628 159294737 844508730 587614917 535163720 548950...

output:

892

result:

ok single line: '892'

Test #28:

score: 10
Accepted
time: 46ms
memory: 6364kb

input:

200000 0
928334414 765308070 647532145 288905964 636563484 474553003 57727228 146050130 940405135 480969882 935542188 9254587 805649524 25953082 201415088 142089593 898547434 95373893 475945925 153844454 136183218 956919378 64896436 902497186 628152928 856109680 246156945 414860699 225797090 2724467...

output:

881

result:

ok single line: '881'

Test #29:

score: 10
Accepted
time: 42ms
memory: 6408kb

input:

200000 0
124110600 81374338 55801544 554807984 118503174 39856916 98394588 823232722 692386664 423840967 119070060 5010328 20053570 670345131 115064418 985614832 742997905 977819959 696444734 955058477 339020896 817435437 131659843 141748824 232152187 594559027 795223271 905377167 916495996 53640035...

output:

889

result:

ok single line: '889'

Test #30:

score: 10
Accepted
time: 42ms
memory: 6412kb

input:

200000 0
172403139 514394201 683315712 820644468 578602535 593216816 286545597 649869835 30211166 966315482 973866877 148249716 301726987 75807601 28713748 818351960 587513912 7749672 64361654 608788851 628225935 469597690 198357714 913901299 163914091 102321453 196805950 78131385 607129366 91524050...

output:

893

result:

ok single line: '893'

Test #31:

score: 10
Accepted
time: 19ms
memory: 6520kb

input:

200000 0
10420 2 14601 2 18022 2 25858 1 37979 1 45949 2 50967 1 63771 1 65912 2 71162 3 72446 3 76089 3 91427 2 95458 3 97462 3 110955 1 112507 3 113568 2 117257 1 121956 1 156535 3 158470 1 166098 1 171672 3 190904 2 191890 1 194394 3 209654 2 214385 2 216451 2 221936 2 225792 1 227397 2 230089 2 ...

output:

99990

result:

ok single line: '99990'

Subtask #5:

score: 20
Accepted

Test #32:

score: 20
Accepted
time: 11ms
memory: 4652kb

input:

50000 5
165446013 98145084 694727298 308603474 530981824 275132833 356865482 391259062 924834930 261408670 760936828 988669920 696961897 163994880 242764402 521179179 613398126 980380072 537135254 17268792 460893491 28651233 135997198 962758639 286416671 124326945 134874624 491603597 665106818 13200...

output:

434

result:

ok single line: '434'

Test #33:

score: 20
Accepted
time: 11ms
memory: 4368kb

input:

50000 5
30330174 497623455 250577339 42701454 8984352 357940899 602467159 578023790 587010428 18670335 441159069 302053118 375181341 762663964 156413732 688442051 768882119 137173863 830781667 818482815 788613957 110898245 69299327 276558536 612549885 821141888 536457303 318849379 355740188 80592260...

output:

429

result:

ok single line: '429'

Test #34:

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

input:

50000 5
921377288 201575304 806427380 223135031 598598659 156469020 414316150 252339345 45781371 923481183 348222133 702191142 94082863 933634249 77420588 291778727 924431648 892755851 51214940 472213189 178632874 897035926 2601456 631673474 216483608 776944930 85523629 1388487 46373558 520164147 57...

output:

440

result:

ok single line: '440'

Test #35:

score: 20
Accepted
time: 5ms
memory: 4492kb

input:

50000 5
90416 1 103320 2 138529 2 154216 3 200218 2 274111 3 307130 3 316717 3 348158 1 348989 3 373924 2 402075 1 443912 2 500093 2 532100 1 541640 1 598448 3 609756 1 676380 3 687359 3 819135 3 829548 1 852708 2 863217 1 866000 1 894615 2 930917 2 1041954 1 1054053 3 1058049 2 1174485 2 1245089 3 ...

output:

24999

result:

ok single line: '24999'

Test #36:

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

input:

13 5
1 2 3 4 1 2 3 4 40 5 6 7 8

output:

12

result:

ok single line: '12'

Test #37:

score: 20
Accepted
time: 5ms
memory: 4584kb

input:

50000 5
6 2 8 4 10 6 12 8 14 10 16 12 18 14 20 16 22 18 24 20 26 22 28 24 30 26 32 28 34 30 36 32 38 34 40 36 42 38 44 40 46 42 48 44 50 46 52 48 54 50 56 52 58 54 60 56 62 58 64 60 66 62 68 64 70 66 72 68 74 70 76 72 78 74 80 76 82 78 84 80 86 82 88 84 90 86 92 88 94 90 96 92 98 94 100 96 102 98 10...

output:

25001

result:

ok single line: '25001'

Test #38:

score: 20
Accepted
time: 9ms
memory: 6272kb

input:

50000 5
617658732 452489169 437310477 421540199 480431339 371138535 442802844 584813693 388097039 438070043 643165240 398503482 590160324 411187563 583455258 376080350 392835455 471798294 639630667 407974563 337276719 618002504 388323193 513562001 428034224 430900802 592062457 614737036 572294165 35...

output:

501

result:

ok single line: '501'

Subtask #6:

score: 17
Accepted

Test #39:

score: 17
Accepted
time: 20ms
memory: 4972kb

input:

100000 1000000000
63384717 781653951 445353134 640210891 11077309 391744937 844154745 332814858 576043427 761048886 531719219 695871389 417174536 900771298 949655068 79952013 133344031 895315964 182365048 681841617 90723369 39166390 24708801 558786361 302019714 89359153 425174982 751891373 942468027...

output:

871

result:

ok single line: '871'

Test #40:

score: 17
Accepted
time: 20ms
memory: 6128kb

input:

100000 1000000000
279875119 229938840 1203175 374374407 528823331 758671206 115177896 7130413 233615721 518310551 670311142 594851649 408528558 499374846 36005738 912689141 141409911 222237971 961866239 811911657 418443835 178715867 91472208 798037999 596881306 508793201 320725989 222838059 51431671...

output:

880

result:

ok single line: '880'

Test #41:

score: 17
Accepted
time: 41ms
memory: 6416kb

input:

200000 1000000000
475651305 469259919 557053216 108537923 226177791 21886173 220456761 318554033 895791219 871845898 570109444 409392611 60735646 98043930 25127240 745426269 296893904 807691743 553534331 136786014 548802996 829218304 305653726 889871526 200880565 811912722 919077774 50083841 8236833...

output:

1246

result:

ok single line: '1246'

Test #42:

score: 17
Accepted
time: 14ms
memory: 6332kb

input:

200000 1000000000
1606 3 9052 2 9486 3 10265 1 14474 1 21440 2 35884 3 36848 2 44329 3 60143 1 62416 1 71234 3 81713 2 98777 3 100270 2 103116 2 106961 1 124486 3 129105 2 129465 1 131487 1 133578 1 134704 2 141071 3 145446 3 146569 2 146733 3 163909 3 184066 3 187759 2 189654 3 194047 1 194532 3 20...

output:

99998

result:

ok single line: '99998'

Test #43:

score: 17
Accepted
time: 9ms
memory: 5364kb

input:

100000 1000000000
101 2 103 4 105 6 107 8 109 10 111 12 113 14 115 16 117 18 119 20 121 22 123 24 125 26 127 28 129 30 131 32 133 34 135 36 137 38 139 40 141 42 143 44 145 46 147 48 149 50 151 52 153 54 155 56 157 58 159 60 161 62 163 64 165 66 167 68 169 70 171 72 173 74 175 76 177 78 179 80 181 82...

output:

50001

result:

ok single line: '50001'

Test #44:

score: 17
Accepted
time: 10ms
memory: 6264kb

input:

190000 1000000000
95001 95002 95003 95004 95005 95006 95007 95008 95009 95010 95011 95012 95013 95014 95015 95016 95017 95018 95019 95020 95021 95022 95023 95024 95025 95026 95027 95028 95029 95030 95031 95032 95033 95034 95035 95036 95037 95038 95039 95040 95041 95042 95043 95044 95045 95046 95047 ...

output:

95001

result:

ok single line: '95001'

Test #45:

score: 17
Accepted
time: 17ms
memory: 6284kb

input:

190000 1000000000
999999999 999999998 999999997 999999996 999999995 999999994 999999993 999999992 999999991 999999990 999999989 999999988 999999987 999999986 999999985 999999984 999999983 999999982 999999981 999999980 999999979 999999978 999999977 999999976 999999975 999999974 999999973 999999972 99...

output:

95001

result:

ok single line: '95001'

Test #46:

score: 17
Accepted
time: 16ms
memory: 5212kb

input:

100000 1000000000
533804807 386840450 521269647 576799417 627193494 473948852 550790405 489105936 408158412 357257030 538983979 357968681 556878643 481231779 519092564 403249785 607992960 386799722 475283388 555753233 374113507 550184884 560950531 593193623 443702803 581782699 635095433 518725716 44...

output:

862

result:

ok single line: '862'

Subtask #7:

score: 25
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Test #47:

score: 25
Accepted
time: 22ms
memory: 4956kb

input:

100000 100
333578340 513969336 195978970 824400195 638656441 786675792 816039642 238078520 929438134 113139919 302567146 891894439 383827319 637482180 152827224 533665091 505871823 810251856 319954344 948487319 279446754 106984012 37996686 80331360 317688293 240575936 715475340 847902693 72411125 96...

output:

617

result:

ok single line: '617'

Test #48:

score: 25
Accepted
time: 22ms
memory: 5208kb

input:

100000 1000
618129122 185229423 751829011 558563711 246239451 875217774 627954169 563762965 267262636 277016530 248020435 112284285 705607875 236151264 66476554 781081429 661355816 307302079 687871264 210352 48273713 99049842 895305444 975384299 581278263 543695457 30425631 20656911 763044495 274609...

output:

619

result:

ok single line: '619'

Test #49:

score: 25
Accepted
time: 46ms
memory: 6132kb

input:

200000 10000
725130714 736944534 839804598 854756421 293661189 905339605 707680488 405519887 605087138 627794319 340957371 116528544 120095219 834820348 167357766 948344301 330578305 722627635 908370073 801424375 918973118 238599319 828542037 263932876 962206126 153119487 628777416 45927480 69380578...

output:

885

result:

ok single line: '885'

Test #50:

score: 25
Accepted
time: 14ms
memory: 6520kb

input:

200000 1000
3673 1 13783 1 14749 3 26416 1 34733 3 35333 1 38779 3 42860 1 43143 2 55733 2 67443 2 71905 3 92264 1 94532 1 94894 3 95019 3 96196 3 104310 2 106707 3 109779 2 111241 2 122389 3 123575 3 134057 1 136356 2 140040 2 140457 1 140642 1 145355 2 151085 2 160173 3 164399 1 175294 2 181892 1 ...

output:

99990

result:

ok single line: '99990'

Test #51:

score: 25
Accepted
time: 17ms
memory: 5876kb

input:

149998 50000
1 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:

149997

result:

ok single line: '149997'

Test #52:

score: 25
Accepted
time: 18ms
memory: 6336kb

input:

200000 1000
1001 2 1003 4 1005 6 1007 8 1009 10 1011 12 1013 14 1015 16 1017 18 1019 20 1021 22 1023 24 1025 26 1027 28 1029 30 1031 32 1033 34 1035 36 1037 38 1039 40 1041 42 1043 44 1045 46 1047 48 1049 50 1051 52 1053 54 1055 56 1057 58 1059 60 1061 62 1063 64 1065 66 1067 68 1069 70 1071 72 1073...

output:

100001

result:

ok single line: '100001'

Test #53:

score: 25
Accepted
time: 16ms
memory: 6520kb

input:

200000 1000000000
100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040 10...

output:

100001

result:

ok single line: '100001'

Test #54:

score: 25
Accepted
time: 13ms
memory: 6528kb

input:

200000 1000000000
999999999 999999998 999999997 999999996 999999995 999999994 999999993 999999992 999999991 999999990 999999989 999999988 999999987 999999986 999999985 999999984 999999983 999999982 999999981 999999980 999999979 999999978 999999977 999999976 999999975 999999974 999999973 999999972 99...

output:

100001

result:

ok single line: '100001'

Test #55:

score: 25
Accepted
time: 34ms
memory: 6412kb

input:

200000 777
559910078 525490667 617287889 453991769 500228490 538413332 562498161 413168774 390421693 429094328 527739652 639955818 612464974 619339115 587041766 448940503 508427642 394860762 462136678 358995561 591187114 378083258 533123127 644299132 603361558 516666630 413044422 552015030 336440205...

output:

1013

result:

ok single line: '1013'