CT30927

Zane and the Calm Window

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

In the canyon post of Redrock, Zane the reckoner keeps careful count of the segments. Decode the foreman's shorthand notes, 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 <= 1118; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 696 651 822245315 14226500 777494199 565354351 489377927 204692450 616922599 570270203 393473607 972441163 404667344 720130670 670310929 248917598 619346835 802632478 828084006 74431783 466220666 333864309 231811861 108299710 564676981 125334824 687331315 619685131 473656229 558643812 214496945 291367663 415926202 273648498 255283886 159161635 93289386 396682712 218546805 382907809 369901178 999567528 304652890 591180883 913552687 542751606 206732985 993671559 943743589 690082662 748094126 26029795 747900821 352012965 330351692 564934517 586779494 235211292 493681113 302717872 243364256 842865341 539445302 564050240 612838732 585764934 31197707 999069333 906917735 104135996 800210035 799205352 612301150 402154974 633031519 634897346 150520687 792219609 299565406 397555721 738201248 7560315…
Output: 319362498930

Example 2:

Input: 580 561 624530152 779076171 176113927 492008982 942494535 217585583 186193024 104729021 242510119 363000849 779378624 801983850 849162609 877046254 708841951 126227028 527518078 357365872 308991046 963266635 432918994 631024202 800448756 4258548 192662454 612340427 74624783 370975362 742473704 600511692 245442144 985502367 637498878 611380534 229309703 447094791 72838471 74060968 632251645 359185330 350971904 246427861 489632920 716153285 679195108 247307433 923706087 126381384 502538947 695499083 484953372 475177200 509927682 990984141 665739310 644548078 901874633 759890670 476469857 441996638 172178903 585149691 78570582 142167613 3278252 915908895 840294326 343247367 49854693 711345370 470781172 81977900 620287734 684663021 602433273 640963317 864100816 592176852 229857761 734308464 73…
Output: 286850460842

Example 3:

Input: 969 359 372836958 146592175 906115827 42023925 741271663 490714854 344572485 441677791 616975805 784567897 529253721 405194238 512280737 22868088 413783801 830320822 698931927 47243660 559258322 379780804 88806962 14755908 896862600 605618815 99879786 238750972 817477486 32998478 62936832 840312594 677375139 564035516 191313754 480548660 162469439 964333678 12248809 616554504 299659684 683641462 659687007 872348426 495144862 156118939 823066102 520942716 274046478 990356470 998620311 644784919 268498983 819760466 262094451 343765481 867104433 970685884 993587711 967069250 469612487 827190584 286739636 31012084 714055689 689687442 646803693 937908280 863357487 432461401 101509059 243464764 617523995 963199341 974649733 292902257 462733785 982163365 614889990 715772355 336314276 928189504 30…
Output: 176268550734

Constraints:

1 <= k <= n <= 1118; -1000000 <= a[i] <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.