CT48990

Surveyor's Brass scrolls

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Caravans arrive at the alabaster quarry of Whitestone with crates of scrolls, and Surveyor the scribe must account for every last one. 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 <= 2905; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 1461 603 509450352 731220930 22830877 520228571 499917213 268010446 739324865 818350762 179208252 662478338 962693401 183753436 538240580 83578254 851506435 120132658 156520654 957189430 241399981 786266420 789977743 783807635 902997696 523947287 364971254 272409075 981432443 473308101 203017306 744238163 677910440 485255971 751524076 754566087 591565040 739339579 226398097 838422457 364577496 480294762 294018727 471295459 564302662 52832743 259420552 924896606 364096330 32354334 988411746 383373759 984353014 650557129 887991906 849767126 855896033 478763739 885132053 333654236 51321627 176360842 164390934 82096672 898431800 907547845 422943805 494111576 923988534 88175884 155847760 509106219 839467520 931070226 325921645 554022786 91417480 409486903 326359513 309527992 428421182 605873734…
Output: 296462941677

Example 2:

Input: 464 136 646666465 138300324 306614330 551287259 416566879 668929218 266454661 217077900 82592740 396092238 897099352 449453437 901402796 756981708 739599774 164752550 331187868 854607996 298348796 556839910 529216444 196714499 710765533 293868046 229277447 741841575 597670484 855370088 900669838 480937496 135024623 822146068 868180869 29494912 87978284 426025617 260299419 681594642 594085870 25313685 630560752 51032130 313229545 932806139 584511433 579530871 818390187 3437667 185314043 820496156 301656244 181044312 56597771 944874167 309487030 837626961 82833316 194021642 600496425 145291058 184182659 598141097 312450970 600896852 669198611 615046405 810889969 264643716 927480197 154830384 114681785 732881889 474123221 933894909 637910495 645286537 162228618 543911870 801637670 265547746 2…
Output: 64717355462

Example 3:

Input: 1786 1542 189102907 451908443 94776169 510093153 463399622 711555409 178960250 727242672 307724222 151400331 603500823 267434223 106562188 205246705 913774273 474755779 335540551 726421323 192294694 231211080 690145954 104627835 893451062 224102256 874858697 469878532 529153167 205593796 333263608 629195381 956144794 935506288 932385441 813285771 253840834 66353049 231585515 174757343 635278752 360313808 682001214 172407299 742345479 385387966 461062895 184244903 942766281 698084688 324371516 134908580 545710101 860469112 269394763 189830258 325336618 313733706 122880096 961625052 87445150 288102081 408068554 19318165 523557734 874557642 504966186 249896868 949777390 627027457 622836470 142012836 499035506 884089935 751886994 43240402 180275462 536615047 780593345 139443332 945033357 42780…
Output: 761345985232

Constraints:

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

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