CT31996

The scrolls Calm Window Puzzle

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The council of the singing sands of Echo Dunes pays by the answer, and Quill intends to earn it. First: the full register of scrolls. 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 <= 3209; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 22 10 806135840 134565758 628613384 398209656 225891417 259252190 14952784 763421687 205837007 689916748 452546974 141117662 149260611 727479443 459066641 639355615 593526855 143444802 228830646 69919972 744809166 607577285
Output: 3300406736

Example 2:

Input: 960 498 147786266 130275979 560336879 578275381 768813803 393064960 948433665 70554178 795173510 100506186 440111894 249316460 161642658 202759965 144489008 497177054 184691080 960488720 626382453 126556676 461385557 450575374 257125991 581469190 728773109 43101822 374061 912639037 435777 568688331 298115620 672400066 92721533 354113757 985613237 109926583 966444151 981363302 998091945 163061096 118003981 152176705 590365383 924251775 391108694 844154326 471946106 359348964 562313737 130795207 655579232 230900875 805804211 751814808 409127755 838499829 18495793 679751023 408630037 755051414 538684763 90235323 560332239 343399643 605391662 825998938 849950129 311920902 879102253 940139630 433987253 202799583 618911915 259267196 413408548 880586884 979166357 941663903 581187514 136506282 802…
Output: 239151124701

Example 3:

Input: 724 55 532521915 142745621 924161574 909099054 752777007 328080534 916582584 907735524 670883399 997428041 347792133 537202735 904286236 531665237 631109799 769498791 787252279 382207099 579078848 491304338 527275638 650378430 400276154 920127445 637531394 382691814 509219564 924107726 198224355 338594150 817190930 840377967 327038649 562605741 315790008 706245122 638081629 421043988 228409415 445160626 461115364 60596558 918457323 741037341 566711421 123105821 165471144 149096766 589971288 633507812 986654376 60371310 403289461 470242448 927121631 761531108 173033014 785329697 360837765 143185781 862091714 538878103 112068804 957437623 977596168 764436638 211495402 216536633 491909891 856099150 838124210 19431851 331280248 301278307 829176295 918208737 850319158 827040674 675559083 884990…
Output: 20626196669

Constraints:

1 <= k <= n <= 3209; -1000000 <= a[i] <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
The scrolls Calm Window Puzzle - MEDIUM Coding Problem | CodeTikki