CT36101

Mira's Ledger of windows

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Morning light hits the singing sands of Echo Dunes as Mira unrolls the day's manifest of windows. The tally will decide the next shipment. 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 <= 2355; 0 <= a[i] <= 1000000000.

Example 1:

Input: 1629 205 163878633 909447996 583355268 954666849 190497979 856371214 156508998 504895014 412228726 568707720 217028864 267525838 840467814 359754661 971844195 156150900 315732608 38269646 278517298 104883779 938411086 814942111 208599067 33497902 862920494 819833575 501598264 551539982 19775667 97073448 287142725 13010710 286309063 68401457 417542475 899378471 299557547 413161936 762257942 510797464 642900842 894130157 915812534 955746325 497575251 997451332 239757377 585604813 160856804 617730798 500530651 369794918 828186086 75568123 856489533 435013163 354286796 395077224 282723944 481217931 914898444 144264952 482296440 260734941 105974320 122724607 278199293 73345630 632820054 199372906 851763603 385175243 959348971 763402411 115036927 337062273 343199465 290318584 109692598 980819159…
Output: 94992900826

Example 2:

Input: 648 495 511353314 941275978 357394680 124445333 543435630 515154973 908054686 889857405 492669024 84873458 635079325 89213538 516257076 783693166 837575707 508130809 524221043 450516304 203774195 380908344 888140282 227979892 582821463 238177416 781905781 715846293 380074869 872474509 687656419 299369585 564254427 389897182 570891540 410066708 906649141 338324980 368977806 247244672 335790508 38450892 673878274 920194381 710878162 267954458 306375541 204740089 924443695 407745330 346346137 412537486 786236912 651265156 975031626 543174931 108310384 170220018 74411483 44813431 344615806 576926744 978037228 605364958 986350425 25636432 79917583 44188048 779619288 624591039 351842491 165251005 249710215 783963555 494734262 115136309 501257764 609170842 166539368 800146345 851664945 146771783 …
Output: 247039356308

Example 3:

Input: 1044 533 602597257 420752681 256009024 29478848 105051587 817713943 458815210 17331143 328288701 412184610 861606263 278222663 937735534 782311938 287343351 145770882 624904528 962446260 675847605 126222920 393884240 72295918 828757216 703572599 422357483 1417764 288616701 995793298 235278189 316539397 653317172 319055673 973608939 984198831 883505972 785719280 135219202 990191275 779918877 457639859 66270269 446431209 540889682 768166178 185438226 868784908 390415386 496342909 595803126 188379278 550425579 365871032 246723550 770104115 291843851 871231136 939419806 878391163 62869319 502234465 70531096 522139606 713061893 166653952 525087181 791188413 979548487 828369882 257813038 414891132 297149148 834973875 740695087 53498742 112141187 344778578 230856618 682306306 942042566 380482609 …
Output: 260696174983

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Mira's Ledger of windows - MEDIUM Coding Problem | CodeTikki