CT32000

The stretches at Horselord Plains

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

In the steppe camp of Horselord Plains, Lysander the tallyman keeps careful count of the stretches. chart the migration season, 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 <= 2226; 1 <= a[i] <= 1000000000.

Example 1:

Input: 1742 863 264942912 72095844 67112109 146453938 303780633 600255178 739353099 529993379 334251548 267772103 479715742 9850488 266264154 92941029 535771034 97174884 995291038 239014187 764271330 211501810 768365222 729383684 296865628 1219937 856654668 771361742 116342858 294862349 295585614 395320925 304139574 551249684 968759351 355030996 114270220 944503058 394074935 119103162 452876071 268451687 261892287 924229611 432739611 139369471 831552044 790365991 541960384 668545082 848468854 763944630 598556672 585274065 789194195 138323001 788886982 226842282 48951061 236033837 431662218 266451346 255490694 497078095 157997804 126070756 291946773 651683058 835318199 401906684 88983462 918901785 440167083 744642593 345187689 939908722 612823134 140822918 769020412 974523776 307642338 547622127 6…
Output: 429891340384

Example 2:

Input: 299 149 959890459 328416690 637609559 758772023 265908837 189628805 864947709 160907657 488678656 962241492 946709620 884162768 396449203 934385624 296521159 29111776 208128928 738151532 614225862 786541103 837593668 478362652 673411817 873376242 590323406 116279338 658475951 894489043 414500680 596517889 83766073 663833803 991163690 396942409 939536251 169196722 286176444 549065092 748291645 68044944 808630350 22374915 304490340 520945548 43062214 449099755 550088372 350036611 852085253 54983189 747890790 338485180 734234079 60489185 700870966 908249527 84504655 140249292 145002449 405466654 63257114 879904852 391405344 775479127 485619421 952520525 456590090 146900986 207362553 613149521 6380778 589934897 253097918 701371513 678365749 416791157 685895936 573750613 258990360 208765584 310…
Output: 67688648670

Example 3:

Input: 868 197 790357021 986125925 308457597 593968014 725155305 242606170 516329 876005686 203399631 558114030 767198812 895027724 289630006 749384258 748240706 251117559 577192062 700418224 937024893 996703602 454864261 799105625 285624800 753903635 109549112 613812930 570724042 116466985 275323235 313111999 114950036 672111450 475514816 991951144 329733818 842892917 891176793 146775204 349018229 605049612 815616050 540297870 95519292 839469210 485356467 119192024 952542203 279475126 105440845 735429494 530636316 227178770 175061056 79986988 119520994 82234771 667054695 230044846 537607531 888265454 764488975 582168231 623450368 672284434 56942229 970090880 931164339 976890867 696750238 748621277 655257974 218139239 662972734 83258423 670629466 494208934 465834697 889013024 309736075 998515724 …
Output: 93332904525

Constraints:

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

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