CT52967

Zane's Sable Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the ribbon falls of Cascade Vale; Zane weighs the day's segments manifests and starts the calculations. 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 <= 3426; 0 <= a[i] <= 1000000.

Example 1:

Input: 201 29 460964 306074 945677 763062 739695 915627 118775 595096 264343 790559 589125 119772 443433 297411 82892 929611 393333 63138 550207 742633 169746 702226 895459 319115 437169 682541 676130 401186 389708 544181 398333 271532 785007 190485 268298 581298 987331 575379 267439 638954 80649 278128 386297 537383 144544 829941 873238 609048 868004 642784 832647 513849 101964 944707 682825 36493 109436 629186 332409 584572 867287 374825 512821 230506 546078 675350 129203 176759 21353 913377 963287 171417 911267 706652 883978 502666 842316 996620 639241 215512 807802 401128 828593 955108 841215 421836 499640 383298 426667 947370 412854 80885 58082 361004 983209 3265 139521 436712 567425 983250 604687 190087 973600 597040 278485 455058 461628 811565 640835 854946 148017 346381 887875 528808 5528…
Output: 13111444

Example 2:

Input: 2458 1925 488372 135460 714700 361297 157310 831499 170440 40752 407891 445734 840911 51194 155984 637562 32952 398710 220681 23165 342600 715371 763005 272367 287472 742461 630950 811317 81510 203445 756721 600582 652710 573925 724814 648064 322571 134258 838528 894283 246145 798515 991842 251309 444734 33226 167367 749599 742759 647000 824045 865423 879146 809184 909338 354651 456320 738791 678061 223768 752591 254140 312500 357576 506310 385343 893944 45012 725620 430087 377387 752600 434527 674555 10636 194370 274335 418295 723446 875111 955329 968581 34537 340862 629398 34236 658257 225357 355061 447810 685534 389617 15718 762493 604116 627989 603854 242986 489487 670472 150082 119890 771507 206819 184224 750227 745547 517285 618606 418643 578222 413659 143943 486847 719502 434696 836…
Output: 947147284

Example 3:

Input: 2328 870 48514 171727 311834 916499 220061 340823 468848 767823 784005 652825 580616 501746 61098 547543 135065 521515 226574 689320 329011 13182 414920 153363 25468 231006 111753 96260 822699 424895 473922 836828 84401 465558 712968 449035 891635 545454 22786 8412 673978 893117 653485 410167 503934 439564 700499 724160 221241 177850 318401 536329 595178 220174 514702 875758 805176 783317 191922 337893 849598 603611 504542 557004 686710 251991 33212 830579 851891 946983 538115 874079 172176 115148 853523 281840 92840 108632 945787 834448 704015 23866 200243 232891 526315 820113 134624 668546 460278 850961 640748 183378 935968 356397 463965 910483 765586 46011 764202 229657 562554 128802 131258 597301 472782 42100 725969 350592 178451 89158 323666 476231 542942 179216 707925 239119 518544 5…
Output: 427986824

Constraints:

1 <= k <= n <= 3426; 0 <= a[i] <= 1000000.

Loading...
Test Cases:No test cases
No test cases available.
Zane's Sable Ledger - MEDIUM Coding Problem | CodeTikki