CT50214

The Calm Window Beneath Bloomglass

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Wren the registry keeper watches over the orchid house of Bloomglass's stores of scrolls. A careful computation stands between order and chaos. 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 <= 1116; 0 <= a[i] <= 1000000000.

Example 1:

Input: 818 698 960782413 575919591 181503924 484505967 861700142 50825668 426949259 841776198 4901105 893840266 458681711 35231820 678439871 326025964 56380527 710406194 283109288 619048353 77454408 709696513 999445150 844035368 592082853 532397369 78478208 91613630 362349626 582548256 463830788 86595418 839054170 256774422 955894470 251571973 488785717 49425493 881053104 697298869 241313150 27138156 732895020 271156809 545829245 202488132 540125456 322167462 130014318 83424388 151379139 883426765 722263845 780802324 158693493 979914860 813624636 2303167 962366820 966454280 769198033 792741022 196064969 505129829 997214640 373468541 299089281 843431343 63263517 201636065 321811478 124695266 962112693 387839302 357153697 902495215 987832734 531041791 482438847 443669642 499760214 550691860 5508776…
Output: 346387932242

Example 2:

Input: 852 756 883825720 720951770 117809391 460419552 680830756 357691847 624467202 75944778 607060931 164160838 554932755 163076985 37062984 139896832 206646215 820996809 153678040 189501835 302683047 760795483 771635020 566167405 882312120 716651627 385979458 105471282 251947815 651564613 660542971 809455251 843056817 353537121 196332522 290810224 766236563 467488197 486257489 971214666 951608968 866753049 434784453 807254975 721537409 992313150 802383811 825870418 652190537 885245664 393131403 923676768 332966274 788326874 6865271 786566828 950270597 47810598 28061724 253555823 766562883 168717699 274981077 247162511 112204446 920294080 187106956 563160763 502019014 115992414 127627115 642389595 656043048 991038659 374532798 349468139 134121319 890930413 351576339 949220977 316201367 94100693…
Output: 373498270511

Example 3:

Input: 443 240 223986442 579333008 511570582 566780576 807800467 271787097 90679603 67896974 91873836 902084758 442996530 452530299 792834070 105829516 497077405 737330547 450735240 83195308 834356958 642455961 18610558 29562260 395719240 303084104 98363830 494136283 939626893 863617388 173418428 884169858 487270457 480397684 523766201 71695172 571124833 465323629 672174978 777771710 156928811 858426755 113999087 688900960 762443120 938253028 413785006 336252493 389913557 556728121 861299049 50412870 347393418 727095646 706480024 487156407 76719544 276427256 120468604 209960630 332714387 560846572 934539681 552542938 675838255 673817148 591799597 242479488 939640280 453535992 190163325 52177988 384514336 615272140 963822896 50387656 614692785 955004889 402952161 797040089 984773080 145050861 3638…
Output: 110154689071

Constraints:

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

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