CT35911

Elsa's panels Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the bamboo terraces of Verdantstep close for winter, Elsa must finish the panels ledger - one figure at a time. 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 <= 1914; 0 <= a[i] <= 1000000000.

Example 1:

Input: 864 194 609133138 34526632 377437657 408454271 987712683 665812522 92060938 841544042 599976121 545405994 428498317 698305133 313109171 833591951 667364861 212012368 640655870 851422469 944049008 958486974 404590098 263410262 316770294 563330143 880739323 713789755 298730243 909410885 4868807 22951949 595603745 100695245 381263886 207997215 480610971 590201536 749290762 674929634 570748826 141192096 750951073 468569117 93184700 551840245 400378985 878071104 551130918 51145324 487707643 311266165 274310080 989763212 686402489 403172444 610895293 918535362 248362036 421920279 703813941 870249328 879738872 215724825 437248409 194034010 405533526 306141669 630562396 929768641 308972904 316213744 936575463 950050565 404407281 599984356 677192335 908457669 22839298 519600783 235529357 540671855 …
Output: 88729715382

Example 2:

Input: 48 30 716370355 992916640 628612654 244558538 41062533 65130213 255148689 977269899 450278971 825863118 457665312 593809654 107875518 675395742 784287301 105530676 337734949 450515610 171188944 18981827 174720194 573002249 847925349 504475393 797090257 999682096 486289578 383426959 534281842 70648085 497099039 118850574 326461415 597520255 814529796 40356171 713979736 728006049 177355392 224697623 939157855 655366055 799188738 687238266 833736130 316415507 981212754 419147276
Output: 12876250524

Example 3:

Input: 335 207 839672594 115349536 849749171 301935968 876427348 173950953 882316514 954860442 234587486 687375265 781473252 727636164 700775002 681404236 74180552 589343614 553323796 449633925 804152792 853263734 579292462 739814449 252826230 533423698 318786268 428504574 267972711 27107365 496529434 421742666 627688519 597054624 973958883 284918720 445473971 189391150 658639595 824810010 159552106 81386910 394927326 262814592 664688111 665889215 113562271 581310044 903447113 685508194 928510109 698237099 118955522 19837652 783525186 200069729 722874687 752052253 289219430 740423651 595753472 409661722 202190659 513988029 195162627 848542553 728678867 75117729 779702674 592005877 341089630 446040443 181942992 218510653 657949925 192272668 217198545 473158751 190589136 819750891 254740081 8884991…
Output: 96707654563

Constraints:

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

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