CT34640

Quin's panels Calm Window

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Deep in the rookery of Crowhaven, Quin studies rows of panels entries. One clean number will settle the guild's oldest argument. 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 <= 3235; 0 <= a[i] <= 1000000.

Example 1:

Input: 1668 1212 958366 966246 330663 187915 502310 385264 237267 823082 738743 823832 412297 998583 63785 914568 710772 781719 927115 995380 661451 337999 134919 967348 145452 933330 278987 940526 779884 42739 476191 503533 788216 269612 588686 426812 8021 296003 872201 750960 623641 859329 364443 16252 225710 970854 31344 39645 702761 192620 589306 36998 480007 47044 914977 275151 849203 781258 321867 168306 588781 437302 396516 990933 384276 70980 270728 313706 882230 98338 805065 91745 33741 343105 102298 942337 782829 108766 781246 14517 526683 639491 327251 622045 563381 853850 476166 152112 990591 978996 356511 944881 979956 293679 275407 331996 584773 445038 609608 145556 11154 935973 313325 917162 534627 647793 142772 816136 437011 266440 228350 708679 565143 549973 16792 319683 513035 7…
Output: 573847318

Example 2:

Input: 2458 1515 969295 83519 402860 169901 85171 228591 480134 805981 998751 553380 189094 375898 352248 797710 836795 58410 678927 958922 709333 728344 102848 468623 992773 952528 463330 924350 887866 364602 111760 474747 515412 489175 148680 324042 141364 15159 955064 359179 859418 515795 206993 700512 153325 81129 848888 109076 207952 892501 131631 303075 879335 993924 937350 992026 47011 790397 169801 323274 214930 284668 703981 602553 204556 115011 564170 301412 774658 128848 356891 147453 671739 186004 512789 447683 839410 371673 475759 592718 192895 996516 185748 265560 703837 418134 931700 108262 934894 586848 982840 315133 371825 103493 690937 305816 509921 378924 62051 255940 267752 96439 178753 937584 605132 443726 611091 346904 787809 665888 261053 83578 220993 9657 46300 4274 673211…
Output: 761622224

Example 3:

Input: 2469 728 163188 331247 8586 220609 569816 6588 514244 331630 44878 622081 144480 582204 258453 47460 926352 445789 151868 103906 644505 696661 455255 689496 90419 851956 989851 951421 523746 166169 690951 627032 878720 145650 659267 302131 237413 661783 509285 121419 898030 636177 927649 994398 455585 400261 251184 528566 707566 341056 53516 687678 693489 133180 592113 177208 82869 781490 347453 725272 187072 56601 974410 769544 688456 402066 823074 596461 661855 442472 63389 375786 671584 681095 497518 362911 258765 266499 26896 559832 251014 223008 724770 542242 25733 271587 35563 675215 370812 151999 812552 373006 946535 808592 73609 524054 658912 422694 226802 275468 597227 245399 93105 358665 39002 888716 816872 560805 952322 360774 172190 748564 365363 930991 984292 117984 128749 260…
Output: 350738208

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Quin's panels Calm Window - MEDIUM Coding Problem | CodeTikki