CT37391

Jaya's scrolls Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the gull cliffs of Screech Point close for winter, Jaya must finish the scrolls ledger - one figure at a time. 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 <= 3342; 0 <= a[i] <= 1000000.

Example 1:

Input: 2260 180 370803 193691 551632 553081 138166 534334 848680 522514 464590 569451 416272 594605 298577 93660 112546 302013 420109 781365 297078 886663 927530 757633 739188 499891 701279 850713 671772 594475 895306 48810 406400 626427 137862 46115 474663 961273 137894 544491 412725 818097 364638 122109 236374 102695 251348 826289 62492 385344 995921 951773 592754 738811 662518 209279 197125 552243 62269 835763 895781 135201 837298 195710 294230 151543 728708 22801 928046 5103 83306 571694 889071 389212 352004 79154 378193 691655 194919 316127 833172 25694 814788 334582 64756 837718 220216 441267 651605 633167 479131 382965 206417 348568 989017 747715 179317 930774 427312 461202 939558 419352 76059 224910 151767 369537 711595 283350 256598 876549 731946 751446 44902 520811 759688 713995 153178 …
Output: 79433302

Example 2:

Input: 2891 1526 644097 449393 571150 653267 408346 416037 263025 771355 640797 756039 219305 933583 309916 367613 963381 102826 635532 291976 536625 99766 237220 739397 69329 931308 78927 243323 835052 723954 407676 133976 58117 733320 810768 910293 176482 402482 727587 564829 438384 861641 126018 445999 696037 139906 242553 389900 635337 687981 88846 455175 956806 869124 403637 259673 356905 497477 530219 473505 651794 830862 139772 551104 861886 776337 247042 517322 418057 522965 354665 215466 983090 949256 395363 629145 372998 589236 632966 391259 600576 63921 899291 579950 218666 479716 975664 203468 260710 355707 197679 156513 7652 131435 39434 216495 749627 186534 167285 356797 205751 548671 749433 966232 694580 723510 615644 177683 476518 480064 775287 748043 279234 789841 535692 219613 7…
Output: 752917067

Example 3:

Input: 2034 124 428705 814909 812482 344538 904355 556623 759356 253256 337322 604918 215655 374691 825753 709891 88515 841693 137238 525517 621626 678544 197123 700106 653235 461274 117186 590170 288035 984349 148909 453491 227753 245915 229625 148920 960443 964706 496845 805541 617610 252492 660112 516046 182864 44096 869402 687572 669829 949985 206678 296881 426680 380708 367646 502852 134828 677605 449256 474617 53156 383938 432076 186510 895084 406218 480025 405025 781527 245023 128725 618319 342637 462479 560911 39992 397979 286770 765872 690371 901113 395838 955155 658866 469127 806188 683010 445038 961475 677736 685937 158893 854552 634636 44606 52088 994358 30371 258051 146478 765214 968292 663046 229291 328365 973725 683552 491923 236877 798153 870734 785125 963550 819491 225495 503701 …
Output: 55468788

Constraints:

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

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