CT34533

Rhys's windows Reckoning

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

In the archive halls of Scrollkeep, Rhys the surveyor keeps careful count of the windows. Fulfill a tricky customer order, 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 <= 1030; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 359 141 905984295 165151122 201646371 768711341 567959466 588097575 747266996 681702251 13980162 677583437 55371537 350011205 325184156 649096043 668200209 485883749 686094724 204242065 284119651 95259442 462806470 413083117 525781748 576286332 992268441 107753614 61503620 884863934 568649145 688416281 395062367 104279394 247469585 540757900 943065743 354800252 449548420 673893442 436009119 773461398 201765302 873775886 386605893 532916005 695504799 440277924 882391940 81152805 964771749 225458975 595453879 390501877 832085714 47264619 394363557 901147354 841566320 609459856 755010856 638975584 172802812 560081099 139067023 559702419 19903157 727391128 804641621 857958461 462513378 764879755 202449712 787025074 92727385 165159412 990820796 952911937 371575266 981496267 284739631 880370705 …
Output: 64785156641

Example 2:

Input: 417 213 689901992 446715124 90174049 186969820 318330086 790130723 790608728 607931606 283763201 597150602 969688450 46903342 300217554 960437011 752737049 196314963 476256342 978535688 742219718 806966247 598234692 400623198 726746659 49081091 868825330 827700369 528042560 892340661 416339361 831778361 573311061 263355712 768959285 732647341 45775785 733598283 77709672 572075678 829864919 851774579 314596874 665906900 374174295 510916109 352795371 600427987 737714259 551830025 664464901 838692503 727765728 753704998 660640424 859490539 379978585 353627202 725678419 876849887 522847623 44406579 287352120 955840294 -660793 468931771 723171314 818958206 619862000 943379854 943061965 260394231 247283899 892651575 146722613 15581921 566283953 736450110 131003707 986472165 88280803 985493429 80…
Output: 104668937236

Example 3:

Input: 134 47 905448523 442289561 757112005 62153906 758977050 504646958 676813184 86848089 647570752 384152944 12821141 933826062 136156406 732062076 104951897 131736559 243608998 373487770 640712732 817855486 409743762 400367643 502714931 198246158 832119221 721999840 601351256 622098061 455334370 425102524 513935544 278262572 790526651 845694655 293728410 72526768 -566253 994680527 323688112 860621699 683930602 768529217 882204611 620431205 946300089 301451971 471195910 905483434 726995755 758805042 537600787 302982327 954770586 842981455 332730932 194316006 767229073 736793404 507716841 133300291 344003828 75764118 285416891 659782144 195864985 526732454 648211972 592017322 457920525 78992251 991775935 709728509 734687104 690853577 264644967 418947014 894612179 492346634 480613043 563798257 2…
Output: 18680661367

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Rhys's windows Reckoning - MEDIUM Coding Problem | CodeTikki