CT46311

Smoky segments Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Every season at the crane marshes of Stillwater, someone must prove the quality of the harvest. This year the task falls to Porter, armed only with the segments register. 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 <= 3727; 1 <= a[i] <= 1000.

Example 1:

Input: 2220 434 133 198 624 983 760 832 92 287 218 460 954 213 333 617 355 115 929 207 977 576 389 148 496 726 885 867 793 2 142 203 87 583 241 671 558 414 792 140 796 426 648 928 471 487 528 919 381 485 166 270 959 806 669 443 46 859 891 991 832 827 482 561 964 586 940 604 664 123 700 920 649 797 673 364 663 921 342 588 404 488 613 959 372 450 299 390 690 597 105 43 797 825 347 616 826 343 978 754 732 420 515 561 496 597 558 38 27 642 527 429 705 719 136 509 503 264 201 767 223 853 795 934 903 794 698 276 309 601 539 209 528 989 709 400 191 91 944 837 210 601 410 906 126 91 84 301 740 926 186 137 607 554 544 548 91 907 530 226 130 372 77 751 594 300 352 44 137 561 486 275 981 431 561 887 766 783 145 87 806 631 446 865 709 254 502 783 508 558 111 140 803 182 515 244 130 871 573 239 888 263 768 63…
Output: 208597

Example 2:

Input: 2779 2540 451 461 880 722 129 992 226 357 461 952 444 609 918 19 544 916 878 853 272 113 282 234 31 50 520 144 94 339 855 840 791 511 31 428 410 408 379 820 51 554 153 659 330 204 346 445 971 482 510 958 645 310 812 480 139 161 990 973 935 406 947 794 930 35 28 152 831 311 921 689 529 600 856 205 543 59 120 313 18 453 58 377 504 91 556 263 447 608 81 861 496 539 43 627 888 922 67 693 6 631 88 744 768 20 665 113 715 549 316 960 568 80 667 605 264 806 933 423 890 993 559 656 642 2 55 937 262 828 530 20 641 122 354 141 906 646 316 175 775 896 587 515 110 568 608 250 933 306 156 523 228 593 376 332 789 98 695 234 265 618 601 496 13 156 753 777 67 191 925 126 945 698 531 411 363 501 940 330 44 177 509 290 893 761 554 688 759 588 428 536 331 759 716 623 31 955 207 960 61 926 925 330 463 199 400 …
Output: 1248578

Example 3:

Input: 1072 1022 553 761 342 961 526 970 833 830 879 370 663 480 424 135 707 628 547 978 111 226 207 316 110 280 867 439 835 574 551 245 908 465 643 257 242 30 248 328 743 123 932 963 958 536 262 174 309 526 362 843 127 837 338 238 928 796 864 461 17 930 780 371 818 940 728 41 850 954 663 590 237 260 327 136 513 566 394 261 810 187 408 269 542 915 454 495 910 637 345 50 27 418 58 274 440 131 211 225 806 668 405 193 118 512 428 992 710 399 73 12 476 575 278 442 88 140 558 806 149 563 260 410 30 73 531 659 417 525 918 893 451 575 62 569 705 581 575 766 481 945 22 396 540 499 693 72 344 201 148 688 63 46 2 772 982 7 32 721 980 698 142 303 966 171 582 547 917 421 898 272 940 612 471 638 983 234 980 772 811 831 309 30 364 826 94 448 272 42 863 710 211 573 768 696 280 872 901 885 664 32 709 684 869 523…
Output: 497935

Constraints:

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

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