CT44221

The Bright Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the port of Emberfall pays by the answer, and Emir intends to earn it. First: the full register of segments. 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 <= 3584; 1 <= a[i] <= 1000.

Example 1:

Input: 2115 380 441 538 250 216 186 450 696 73 535 552 661 18 650 590 719 744 475 868 324 920 659 816 822 988 722 347 475 387 323 437 537 804 592 117 714 560 174 18 624 98 317 754 844 570 974 801 460 84 520 621 790 961 20 524 275 275 606 464 169 325 838 935 908 552 451 949 812 122 645 905 929 946 776 114 128 789 598 541 822 268 118 578 434 149 387 628 417 740 99 929 152 207 879 545 823 92 166 536 598 24 251 41 467 124 570 321 857 611 100 532 426 124 570 770 478 886 140 899 648 509 553 43 114 748 840 275 110 325 120 380 871 787 203 578 649 233 910 843 562 552 464 33 776 704 161 362 343 552 924 546 49 644 313 177 178 308 646 221 204 310 423 361 532 258 288 667 399 703 544 22 962 167 150 795 539 196 768 54 964 726 615 307 618 493 188 218 71 117 885 903 20 917 268 823 540 726 137 644 963 746 575 771 …
Output: 180809

Example 2:

Input: 435 350 277 243 487 100 83 200 876 598 190 76 101 203 649 414 759 419 318 968 441 227 658 15 668 797 855 871 790 743 937 358 142 380 957 752 820 140 575 11 249 480 613 59 4 662 877 420 682 737 43 168 801 145 653 953 917 633 983 543 699 160 563 120 237 493 371 57 57 691 557 398 398 798 852 917 322 242 421 947 938 799 681 201 288 416 24 677 716 7 329 847 450 904 539 378 971 411 560 515 896 29 883 217 118 556 882 772 711 228 725 922 135 974 92 741 20 437 74 879 670 814 228 38 585 614 640 392 423 466 602 740 718 245 484 332 275 378 921 641 156 793 237 680 202 73 238 330 877 921 456 670 114 577 547 262 622 201 215 735 651 720 818 674 250 324 149 141 928 941 526 42 306 945 55 117 531 172 177 219 958 560 576 470 709 120 947 127 868 370 399 428 603 849 100 791 660 458 433 780 2 823 586 178 261 563…
Output: 174385

Example 3:

Input: 3310 24 242 202 816 364 882 92 459 879 61 416 73 4 676 876 899 996 955 969 56 77 983 559 67 417 56 15 766 63 566 393 299 674 689 908 444 476 948 574 331 739 755 739 852 96 344 982 570 593 491 428 85 784 576 389 618 504 903 44 876 432 679 645 354 448 508 418 431 759 678 634 197 728 960 163 700 740 46 978 534 937 350 512 701 173 193 265 673 482 500 180 118 626 638 88 656 289 65 745 324 484 64 85 135 418 553 329 854 362 231 328 567 666 720 937 36 386 550 28 45 510 256 87 883 233 793 6 866 775 191 995 791 413 661 930 984 398 308 304 622 731 267 587 37 220 661 111 76 551 782 17 964 181 110 676 1000 104 84 158 600 131 331 531 773 949 142 734 696 632 469 289 41 447 201 565 862 708 633 169 328 842 965 97 324 366 980 381 194 642 175 854 818 342 538 697 762 899 253 80 340 81 686 114 502 781 240 559 …
Output: 6589

Constraints:

1 <= k <= n <= 3584; 1 <= a[i] <= 1000.

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