CT55372

Vesper and the Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the cinnabar mines of Vermilion pays by the answer, and Vesper intends to earn it. First: the full register of stretches. Task: Print the minimum sum of any contiguous subarray of length exactly k. Input format: First line: n and k. Second line: n integers. Output format: Print the minimum window sum. Constraints: 1 <= k <= n <= 3740; 0 <= a[i] <= 1000000000.

Example 1:

Input: 2522 1016 654363102 468132619 753896514 447499102 56737935 236372170 934923557 938811113 376796150 536848127 755770320 633015405 866925488 122831609 281205392 341027584 926712477 163966169 742755233 844123019 793953244 784908515 917689012 681050544 316754184 601467501 458756964 576642181 237858199 306036510 209492155 606487051 126067909 907657100 312181 434052421 88555056 700553055 637058532 908493238 280989177 63850053 591448200 716658090 90936764 854101691 523942525 462840667 559541588 278474263 616324319 341994348 614276044 756001529 924405978 79939059 821540859 636161784 774904076 731465759 37367091 848395943 350598034 195392217 547221644 140621182 396616262 25333278 826263369 512490180 148026634 581414541 63848674 937929186 48360590 509941662 401733723 14714472 341223478 856527464 297…
Output: 506980283473

Example 2:

Input: 2912 2613 478294996 482232130 79079481 37651395 598180581 872799794 827617270 58507849 315932481 865346016 454386748 494674094 21847525 444570240 823997657 610250062 729790277 555530755 188566693 427991919 986507637 823466395 85342152 72983861 67546493 275068846 75910732 227217670 508654314 884445362 936266952 317634140 403472609 339062574 688433164 885673203 777514193 536956036 884777479 695205881 201253181 348166553 556515567 418005483 213367507 718631959 580835274 897235661 656234813 17500867 983454128 723400897 800394995 714104779 419500022 433292843 84280244 446020782 558395413 848276788 675721507 683058418 817553997 877482825 600930576 788047519 772995246 364224050 373712849 539665149 633175388 984786496 505798365 590699660 734680705 607701516 851851198 268225955 328519213 76254565 1…
Output: 1296971332386

Example 3:

Input: 2723 1329 640365837 576992932 101986691 388390397 908814438 381469459 381576833 930385895 366730108 338670733 420092543 782435351 593644559 580546345 932896695 638212259 756096420 782278099 944065635 815744689 36427329 867069622 44203857 824251640 464293087 501899569 454258646 390643244 839106255 205710769 931586361 743877663 139224056 947894547 275000414 439460850 924172249 248311771 271554981 164143660 743184300 583028479 746049564 155618560 838146362 426391583 144316637 18942308 857147917 755919587 981389712 659816027 253115437 522163803 284931344 287054904 337145391 174539679 926341647 10679478 374339330 500029564 484253417 512237137 951833850 389548283 685381059 294841248 666528307 694300228 259872644 300359366 756011631 914857457 371279339 651823483 986880858 732342635 333986934 8455…
Output: 643573911967

Constraints:

1 <= k <= n <= 3740; 0 <= a[i] <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
Vesper and the Calm Window - MEDIUM Coding Problem | CodeTikki