CT55915

Last panels of Baron

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Every season at the fox den of Rustwood, someone must plan the harvest festival. This year the task falls to Baron, armed only with the panels 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 <= 1935; 0 <= a[i] <= 1000000.

Example 1:

Input: 1004 270 644040 2857 961485 348524 619060 707969 143764 551345 361355 386845 163776 538529 224528 465780 314547 11642 538694 963579 613685 927238 361634 855769 483496 51621 86339 64083 577639 814906 928094 5178 356657 963813 969487 317443 171231 769424 908714 207227 429908 535903 149764 940188 530580 112381 169316 144987 813874 489671 849770 941644 663535 287323 772183 835817 993126 746285 800137 775113 389038 775924 475449 132074 875761 166027 384772 9200 852841 845913 767524 622876 609721 213475 368999 382979 63686 840511 62756 774591 851555 866728 850412 66237 637765 566041 800720 940050 503669 897510 80318 551276 366144 567389 48266 938443 674516 404801 529800 640373 839682 823894 492145 990566 659510 999570 84570 999416 943221 570808 639193 785965 307607 874842 993869 289447 903837 55…
Output: 123483892

Example 2:

Input: 1044 446 424553 581804 499078 215766 100198 223851 576080 396595 969920 415750 851981 158014 107651 397116 44395 776120 560712 5944 143050 602815 401755 732458 746046 244430 842733 725027 125684 446930 175921 497690 714065 604333 298600 682102 857815 931445 171254 509240 433269 786640 711325 904472 628986 599822 218011 665269 455923 8127 736108 134543 241218 157875 614893 354556 385013 632844 704561 763374 261895 145707 56372 829925 236310 386170 922252 437227 8677 768355 418457 737216 764267 290434 755926 894023 821384 986987 469150 653967 264368 28856 716601 977790 554058 603269 946332 857973 439931 781511 232501 208524 406894 757375 954375 851750 822251 630991 664657 363488 250486 661871 7544 323606 183761 229139 964238 641076 665460 498241 457975 54764 380803 400744 298006 768019 28137…
Output: 206107928

Example 3:

Input: 1740 1341 639954 592355 443168 130765 579454 995667 606440 208068 797421 460393 50790 311210 256509 945396 697571 614208 611754 366072 959014 300242 18896 409233 102428 255292 766506 199851 760466 378701 712247 452848 497167 974256 47742 904245 809664 231131 958132 848340 657057 380777 123283 213221 21538 416987 932276 298766 649624 663648 31592 779605 853821 388332 332529 453691 582891 529547 67361 231095 473240 872471 390943 978882 961348 188819 151747 792303 266492 625297 369943 189282 181464 756728 438831 73058 816997 117629 225691 712072 600026 424016 924620 660818 706943 272725 779965 642491 946455 840930 104136 318598 698559 501527 539251 732195 632214 261057 293526 977347 807852 243356 969121 853986 517614 351686 339089 984755 807287 246974 478906 236900 759414 957007 238364 520688…
Output: 673994656

Constraints:

1 <= k <= n <= 1935; 0 <= a[i] <= 1000000.

Loading...
Test Cases:No test cases
No test cases available.
Last panels of Baron - MEDIUM Coding Problem | CodeTikki