CT37058

The Gilded Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

In the northern keep of Frostgate, Bishop the scribe keeps careful count of the windows. Fulfill a tricky customer order, every figure matters. 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 <= 2511; 0 <= a[i] <= 1000000000.

Example 1:

Input: 2022 1286 91677625 922356562 188878111 834740182 374981771 416591328 225871211 377092414 481308168 696349613 479751323 653326986 555416992 884434485 176148717 229831246 76705395 358794874 183892226 233167290 318586834 279402981 576064576 950532531 325331350 905728758 643493852 865157078 615945814 193994874 105921907 906045096 18927383 787888378 423641248 21070464 531050525 207233377 509314210 718800229 905004743 495291106 702714298 807399232 878396606 645849459 710374272 267614341 223232240 113306305 961945706 376148407 987260010 812972758 165225646 498695901 32688276 448391692 450181761 922348895 885691291 490291024 921277770 704215985 307677377 538282992 245568308 576574443 34060901 235762481 277580748 892139015 491818255 864547349 994635289 167750774 772944784 612502641 111912209 660446…
Output: 644787168590

Example 2:

Input: 403 350 418425056 623192264 243603806 613152520 216313586 385381574 874591732 333412386 73167368 532706620 251013493 860834058 889346858 827269924 570573056 751921125 539267456 332802415 893456075 354733933 561936139 777611698 153841524 761920096 962904227 888044771 754604884 149667132 878997958 955193163 196435087 254955011 624944673 385067939 82980828 568300986 82208243 923978169 587757226 6498273 476576185 988936841 551410979 422065947 766614709 44066343 275491987 847539214 297402612 887292692 645722945 775553363 893012225 592393972 427420649 135494785 251151664 861021117 746279568 952008777 476944251 646233206 605049648 435894779 675602165 754876467 453329793 447227255 658502131 838202199 902620925 536416796 320485074 678310797 297055856 604909836 863649568 721590220 939687820 22333500…
Output: 180844146132

Example 3:

Input: 977 288 877746827 893841982 244646423 640294833 249775560 254277737 596868778 332179548 106845760 702193006 996160614 251950303 744212845 61762937 450207845 762554081 188665160 497554832 522198614 173680595 995697771 487855000 926463926 912133753 47042557 445325301 472637544 718376175 715064107 573037311 435336081 76987922 959786913 470535281 856981496 474808113 939489484 318927397 204618234 998051879 605598755 898172614 594112600 720979393 954308406 55594709 779295954 169726272 379904680 868775617 174297503 755252763 628447581 450109131 936216121 117985737 680553352 652845249 534648120 793318176 193492016 330043125 406873343 693861468 257571183 193863685 990484408 961201132 511279263 550452250 658909699 936295692 802695896 365593550 569582853 563476824 109321565 907113064 376415432 593755…
Output: 139062631711

Constraints:

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

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