CT32514

Zane's windows Reckoning

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Deep in the rook towers of Chessfield, Zane studies rows of windows entries. One clean number will settle the guild's oldest argument. 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 <= 1570; -1000000 <= a[i] <= 1000000.

Example 1:

Input: 255 219 593546 -603184 -630870 748682 825783 -729302 882093 91966 -663128 772948 305627 940816 769825 602178 750317 -594608 147079 -614975 454092 -704367 -355452 -286487 440529 -637492 -625055 755643 -316552 2657 436274 955960 356851 -536255 -510660 380405 236646 868659 -30281 139240 -126806 -945302 392019 -781737 8290 301902 452102 -358132 -649143 236708 -877762 484110 -793153 636908 806760 572951 -67524 -17933 -589529 -614413 -901580 -38150 -887972 344485 387945 949481 585784 22319 334893 43244 -536865 97784 199478 -15620 110569 536881 -219007 -241105 -988408 492395 877639 -582348 433013 43991 463650 677002 149440 -73642 698742 -908536 86125 437709 -505056 902121 649042 -500825 -26841 -753344 -224170 -492402 266171 344773 794600 605836 793408 -8236 492349 -583464 -277912 633351 769164 -4…
Output: 10370106

Example 2:

Input: 1459 439 -981780 75640 350760 -867669 -29338 823087 -517581 464863 -810850 180628 768324 -725182 -103101 745664 551176 308485 -374275 -635375 841336 -215420 973825 -729501 77229 817837 -904526 998809 682580 -652425 663602 -175942 -270794 757246 -911854 264201 678645 74198 352733 509229 523662 645687 729537 385886 -716912 -338142 661971 -168007 744453 -1645 -129461 -991641 436199 -620668 472762 770008 -727382 -989809 224847 777842 589046 495118 483492 -949591 678818 -97310 943914 703252 687163 -76150 503982 816701 807268 -775126 758144 -243517 -449761 -824185 -140250 -385202 -805375 21559 870277 935803 996387 161900 899543 -561442 -629084 629565 -298011 217345 -725800 523817 -1654 185850 -603996 -488441 -396829 -479472 -629210 623959 -838405 452370 26502 -442439 697236 496492 -528644 -45315…
Output: -9290042

Example 3:

Input: 1516 1516 -515053 -578920 98094 -71310 -401074 912029 -904997 -345130 -225491 648250 -691879 334633 -495629 -164452 238974 886595 733095 80143 517968 -751527 929941 -48670 -474751 -521188 264066 813834 -461244 -486478 -644619 -677771 286813 -13428 360434 687219 -317138 198880 -52991 -182681 337381 -970604 -579971 -268692 181814 -997703 -865290 879959 -842600 -543017 -549378 -232426 -222348 442330 -504254 -164881 973978 759487 775455 493831 -691373 -184343 -15365 -174560 109683 69298 93751 -858819 -243103 606606 -249942 782340 -405145 -141884 394401 608562 103144 657694 -699985 -787945 -30867 645542 -784938 -897818 996822 621248 -392592 -78222 251531 -90432 60811 -867991 -280361 -593271 250827 175574 -534303 124240 -389660 554221 898627 464706 -17211 -781020 -874582 308775 578765 -115458 96…
Output: 5446185

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Zane's windows Reckoning - MEDIUM Coding Problem | CodeTikki