CT43790

Archivist's panels Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

In the frontier camp of Duskwood, Archivist the paymaster keeps careful count of the panels. Schedule the next expedition, every figure matters. 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 <= 1564; 0 <= a[i] <= 1000000000.

Example 1:

Input: 268 2 57060571 863710671 673190380 205382352 508901748 511351267 79940440 579828203 68861450 817345072 55718772 844217353 597052434 256006421 942204898 998288732 976086616 662689656 19397148 282237997 838993827 485094285 462665987 141648152 154476721 416079784 892888087 54561544 218414867 560614928 596152210 914846287 996026183 725045034 666177922 219260214 209194309 717554453 321667851 784392564 413090849 809112996 692578325 883300616 644064027 541404676 161104748 393443104 520188731 142305096 446384436 828506132 288312538 4499604 181589748 692791527 254468979 262750041 502541617 982333597 777396433 725050335 192587951 166364663 726904286 117869052 111182212 357640405 325462460 658914133 175775592 609284355 212377699 98426126 523726117 542815753 62493626 365364104 333979023 220086539 1552…
Output: 89112180

Example 2:

Input: 1524 147 814920771 94360152 241471572 986017127 226483943 666036770 308280931 224944672 431705850 247228362 963182145 540828880 858064496 688916531 70640325 239166261 526114829 423130179 641875572 895142901 206952333 846004272 96727908 444021667 105187603 93823768 428543427 325957416 880703844 783535436 642138408 85937338 838746615 27904774 503654953 233642842 434991370 290258091 939256961 303302484 875393369 758130030 332575210 300471754 980986022 53573692 990666544 615566002 775395742 406352829 426539915 652985489 638528597 236937317 718160845 905614777 534280718 339704141 350616624 582927831 30705391 556284550 76472657 825778364 392661912 31337893 55752823 371976327 188131330 108126874 395452821 482583436 445304962 835373348 397088673 790978828 963992582 79516650 347418340 837509803 352…
Output: 66267144236

Example 3:

Input: 511 116 651452268 792202366 342887899 462243748 661409421 161429726 626102031 214671417 144361606 974502644 642491174 18631749 162574783 41985128 399063164 75307587 228844791 251837719 114574787 682182224 145680303 623949361 164174444 963419542 456166854 5627704 781436924 486218351 832004449 430363260 841833385 964118230 573336422 44516903 490765937 511837572 376817893 193678106 306200942 752989324 249123840 4816455 219202308 773865806 445264947 275041546 805582667 775130651 135410774 3266033 262937230 232545400 39800750 34336576 262737196 843699453 378875020 74841391 669779056 869293971 585163534 112847821 969318992 78708486 606038747 389483998 889437767 939576111 923289871 144973826 310029859 898588730 312324391 399117264 290084372 762192039 239805991 164541213 343214344 50201816 1872926…
Output: 51856155327

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.