CT42576

The Bronze Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the fen lights of Will-o-Wisp close for winter, Aldo 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 <= 1354; 0 <= a[i] <= 1000000000.

Example 1:

Input: 743 728 931458596 719769642 27708280 705793552 564476264 474858154 440005028 584498273 845273338 976141407 375335727 835408527 362399409 595837881 229422606 546644312 860278749 65376513 696500372 658573542 845593747 282002393 334667899 799588256 80758189 194142194 252856035 135810746 440966215 656482247 83869802 309265120 162489310 851192002 166586396 798800173 154283839 343650343 475367057 872498194 521565644 647186940 530225502 35012294 589859071 545385514 536571022 780696095 940353823 258282312 94550040 640208268 895399768 852487616 811078101 13580145 579516233 531242583 678098685 861586011 716429360 234825389 420266185 408635598 929411510 617762151 748839342 499563122 674826162 158528312 243179668 671723689 844357294 564611267 310754197 103246605 894906926 807504370 901319862 255360115…
Output: 358366053289

Example 2:

Input: 444 108 462317886 166757160 713241840 379653469 158379574 168690993 186800994 198334558 381355788 567604641 502918080 696095635 938983636 786496939 46605280 414615647 858927822 21546889 451591547 205023492 725839907 242859617 635331153 683481972 649506980 733645499 789219576 412686379 449381948 987321351 137520917 914771923 509682391 540126358 690449323 851137192 965476546 602546082 808617674 351507114 491585682 933480329 533191888 636577313 941506724 116045453 249287049 389788675 953586137 634085426 73204853 464335428 568038637 259880864 401083186 824195565 746997493 531443420 824072483 66863138 336893306 995614347 561860978 966370846 198190464 831518554 778889552 221199279 79583489 155327288 45695699 19734041 868051713 133346598 963769073 634625265 985684259 167120366 685476544 333165403…
Output: 48387540889

Example 3:

Input: 1103 686 596526566 772874561 984013583 341923127 920450437 488507743 417008227 386547369 140708792 776818709 715930214 374385010 354627859 496295606 358493219 392735395 867217227 184884727 936231338 146060444 818806248 417193718 924889273 162981447 721651768 389223787 89996860 493484140 616012319 979715214 991109289 592406783 230516221 393827948 686752818 986042580 605347193 959205186 77952411 353964321 350172566 373209417 721483465 193818648 654803879 744579073 452098925 148553597 445292712 110624547 417467429 723680479 988390015 619211703 509193252 981194022 506070197 973113138 633438501 9430709 580765467 922463328 13810157 78606003 626556638 6452307 763194103 980472873 820368111 923264064 335985816 958603148 721179910 701642541 917149886 723867164 884456319 469011161 710548060 912718316…
Output: 345435189022

Constraints:

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

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