CT34573

Milo's Opal Ledger

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The council of the beacon hill of Lantern Tor pays by the answer, and Milo intends to earn it. First: the full register of ribbons. 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 <= 1224; -1000000 <= a[i] <= 1000.

Example 1:

Input: 687 73 -332152 -502668 -105094 -485548 -662845 -688484 -367988 -541442 -95385 -631534 -391971 -889503 -383597 -762370 -621995 -775310 -781946 -430713 -737678 -548203 -547653 -530546 -11142 -449401 -442906 -843138 -899331 -963413 -621404 -828248 -93097 -705746 -506046 -554746 -519164 -107628 -167334 -695455 -625558 -598554 -555982 -93086 -702439 -884358 -327785 -805569 -554133 -602481 -34520 -145811 -594333 -413924 -447651 -694334 -656613 -559006 -806605 -525843 -746294 -645985 -744741 -299110 -398117 -811608 -209474 -535877 731 -703609 -372670 -428718 -603048 -704099 -660271 -602638 -672350 -573989 -193830 -569090 -784173 -934371 -531826 -176976 -451300 -110985 -266103 -719848 -976751 -920610 -812592 -528101 -654425 -580770 -852009 -951837 -849528 -317218 -410646 -561781 -776192 -257393 -8…
Output: -41996616

Example 2:

Input: 868 264 -370545 -146905 -162824 -77010 -321932 -209387 -18342 -344084 -264973 -370682 -724043 -38186 -596417 -166301 -396676 -717199 -774178 -788956 -584906 -343897 -288519 -103558 -923846 -701023 -740426 -329454 -135356 -444459 -584509 -451807 -46767 -143908 -308065 -254154 -911944 -252284 -38656 -145701 -514494 -443755 -9961 -288268 -871180 -564584 -683135 -237935 -224165 -224041 -490080 -503916 -333820 -833439 -640780 -861265 -251413 -96701 -683720 -643500 -358538 -640281 -606936 -773219 -20299 -730642 -70923 -343443 -482376 -4787 -216813 -704897 -420522 -520782 -693882 -399580 -525631 -626120 -214097 -697079 -780013 -247617 -726852 -88519 -503561 -572916 -686610 -583779 -49360 -180610 -811465 -655098 -694949 -743926 -801640 -88865 -192109 -126118 -108485 -44709 -169053 -427730 -486378 …
Output: -136716334

Example 3:

Input: 118 81 -351941 -455793 -578421 -773787 -170018 -323845 -905386 -857802 -965994 -720724 -417515 -632996 -275807 -441025 -726141 -843373 -746875 -852374 -757136 -503351 -283473 -919477 -881142 -384448 -454123 -492386 -43946 -295164 -50195 -150898 -760881 -29210 -741204 -997638 -916523 -448784 -377618 -855107 -571572 -622508 -587526 -340761 -294334 -32506 -978639 -84998 -107107 -459168 -534274 -935310 -776093 -673711 -873048 -111158 -795048 -691761 -260749 -289091 -409950 -939242 -714264 -253379 -691547 -792138 -194848 -501098 -743638 -828141 -337428 -77685 -790083 -839928 -833411 -250891 -654459 -315685 -440957 -500712 -241542 -545544 -891642 -744843 -951112 -842121 -317012 -819607 -496125 -472462 -74093 -822652 -711183 -632666 -77889 -751828 -335184 -173871 -277895 -797750 -250973 -601155 -…
Output: -45707110

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Milo's Opal Ledger - MEDIUM Coding Problem | CodeTikki