CT32651

The Calm Window Beneath Verdantstep

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The harbor bell rings at the bamboo terraces of Verdantstep; Ulric weighs the day's segments manifests and starts the calculations. 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 <= 2844; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 8 2 896664169 375038288 929954698 735025009 827840556 599225244 351894500 889775576
Output: 951119744

Example 2:

Input: 1334 1131 78764873 868196805 398654726 68972459 367914249 772377171 619848332 958311749 703619894 112723771 468006161 313207099 311582013 472750582 995349268 516792130 540613455 632675427 985774396 294562825 158996056 657809000 243540522 335339387 623153383 632877151 643524304 640632444 311092692 501890019 562568453 282709570 520849293 869200952 832418090 407689392 801789091 491172661 387026231 374274638 140722620 482636041 971436060 805069031 339398707 322276928 368244740 569098064 261395282 378622473 643969738 966932005 69873623 857199256 267404279 354470108 444835033 776898630 41656965 463072304 447273216 860268713 156174488 774008055 324673389 482909496 529649383 78657359 638976290 537262588 867935133 441869114 289502699 216258790 17906306 640586195 769160643 293128717 461748643 299407…
Output: 578864855842

Example 3:

Input: 2280 2258 373865439 170267423 7254610 871367917 163599101 600879006 875385677 390113035 534376145 179509170 769668951 14115679 660690723 59592207 582453308 101900654 82001087 857085126 827954717 13805404 31828367 599321875 683026036 713543516 51488595 782283124 107559090 120077566 316444339 188459271 13205734 142054410 315994769 679587054 28532127 544032123 963737156 841763601 637098772 628813460 335053642 253532319 728549521 284811468 893393991 557088770 303302700 834607007 303350192 167117474 242797023 255452613 531599353 280396043 175740722 931875063 287409584 638122507 649827341 958583370 182621603 223117517 980066166 319280665 153700183 850847550 865210438 927994008 611316474 697906344 731018045 272281598 953781770 734843882 803391307 855131145 166859113 57297338 468565742 167996237 8…
Output: 1133618949368

Constraints:

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

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