CT36014

Moonlit ribbons Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the rook towers of Chessfield pays by the answer, and Uma 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 <= 3575; -1000000 <= a[i] <= 1000000.

Example 1:

Input: 2487 1741 -204002 -162424 -618222 468104 -371618 -449594 -702243 649620 -673778 458923 634818 -962973 116649 686673 162828 790135 -815631 -552270 523962 -212095 736768 -39380 -490678 -879430 273409 -292410 -787381 -149627 -80550 -834773 -811650 -286441 -20933 451012 846487 -708759 -997374 828154 441014 -582518 -214142 -521770 595369 835607 -286969 604545 -156599 -90977 -395932 155522 411743 -676254 -306066 328044 163980 -244294 -421246 829190 -288768 187897 -125303 367535 -651688 930233 250184 -312461 -908760 -790654 -99330 577316 123002 42633 739271 29863 -754815 -834674 790931 -841256 899635 -774543 461439 -872817 907613 930398 193308 58604 937535 -865122 213002 209252 926419 581988 209908 -431285 694174 -181838 332862 -995272 198696 248370 764998 -361223 -279460 -519360 -92772 891864 -4…
Output: 9059512

Example 2:

Input: 876 505 -187050 -139433 900416 -185533 224506 -664244 -417196 576697 378764 232581 736073 -959541 -243224 -818903 -126336 21670 -91191 -360563 -649212 -508320 143631 -814025 129431 -822161 965318 -789226 775807 -756546 -768353 -317399 460378 -286503 -858681 -339297 710746 181740 26591 295372 30314 -530741 127302 387169 -741272 -511614 -616407 359607 -263099 -52024 356109 -850051 -281511 -285268 -834007 316613 660515 -806636 -53895 -730465 762031 640728 78933 820598 294213 -71631 -231585 -199643 -933828 -197692 40252 982886 129802 564383 -921876 -637974 -518696 586514 -601544 530274 -781819 738258 -976925 -860083 317877 -96140 -126069 513271 728564 -412182 528378 436347 -742563 -76408 483104 242470 721778 718069 -994302 820744 -177289 -946655 -738280 804238 38481 -417059 -920446 694213 5389…
Output: -17496838

Example 3:

Input: 2817 33 666888 -993006 855924 195795 172171 -251021 91486 -930707 -643521 984848 -56870 102598 325179 851716 -244156 973732 62373 -960841 -768528 -78299 -392 378081 688082 -384185 254236 276737 174800 -168938 189528 -864427 390727 -393914 -777486 -804568 -541303 -716030 163091 -628774 983215 -509042 -913868 -602578 507026 540579 869315 803174 664413 759418 -161186 -190155 827061 -246001 154980 325102 777927 686790 188861 -779659 -387857 244466 -599590 693809 -900832 767148 -637437 230666 -50019 5366 -632005 -764487 590917 -47780 -667849 709581 -37755 -319212 -979247 -483512 728562 301166 5055 -852709 184596 -864936 863363 -825908 -106262 -611518 -447036 776361 -556462 728375 970105 -664578 -493503 -102654 -721109 87047 -786411 163616 -611337 -933726 225755 587841 925513 -669642 -527614 694…
Output: -9576082

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Moonlit ribbons Calm Window - MEDIUM Coding Problem | CodeTikki