CT32266

The Calm Window of the Mossy windows

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Caravans arrive at the desert outpost of Sandspire with crates of windows, and Milo the log keeper 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 <= 2951; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 1858 871 210484650 236136309 2019397 314655060 215052188 926375573 445024522 757045866 340473069 96563831 828791899 74526679 896442149 999169371 813972768 123304728 503321046 989503109 68394667 195121455 730743417 674524623 913000523 618810786 319545647 896393768 30828634 61344196 677293284 146206828 566810415 634956802 435458454 693658482 570712122 228692400 780107869 149691930 403299440 755997812 264833353 180267784 634945237 250043770 115323442 153390826 246889563 391148911 774200901 822449723 728202825 664530081 926403990 243902487 44228585 761462924 186970602 724293781 826811368 776006713 619312151 889950069 384644722 534318680 14479680 831900073 843403608 646457751 837426868 342814936 555304576 584588347 99867049 738861487 44089267 675182121 112921963 355112135 693943861 229332290 74…
Output: 419306925196

Example 2:

Input: 2395 1466 68535975 581930086 691887461 260292195 476267369 309257705 367077362 755927553 308183584 339641845 85643187 670575406 249299007 776125524 921208239 938210807 579906250 820092799 894443748 544267617 793313623 999088981 238878667 654485738 627559162 743529643 71805525 101709079 262197976 436323790 793775120 462229813 330542854 570691127 124941087 585407744 274208392 17498668 423317886 10306056 205763631 237970570 674255250 235510720 91252588 396437586 988504652 568062187 27281219 744942337 490154834 824128790 837779180 271012403 426328898 781883991 917827357 706537644 877089582 576980868 3333162 901797855 707233729 169387851 779934295 215200093 875655266 455009512 984113652 123012886 321416387 28415077 798367528 322533056 33849819 272120121 6535185 302376945 34484508 549579066 5074…
Output: 707942172897

Example 3:

Input: 1287 821 170296629 706859563 510031929 344094569 758025360 610441546 28973121 459079157 757498529 673755454 406558131 276389080 180523150 482823018 58548909 369130292 276104285 259586696 275701515 848304406 886456449 605442132 523076676 990302154 155767696 299002722 933424966 454993352 515449988 365385669 934925224 199341851 319308977 158987714 990844512 105979393 751744253 724888741 761945241 965542127 77364354 163323960 100094252 54350150 91294119 755018744 529685064 295970748 251983383 304477138 578939719 314455734 288498101 893159036 443995518 913423360 155629869 254564194 651592739 278554031 51746233 585552819 603835677 60233794 279146759 875675646 89939113 930991968 684494285 293585760 890601015 158753300 276781399 40096179 607176034 716474383 41643135 355896441 469056937 65723975 77…
Output: 409894488028

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Calm Window of the Mossy windows - MEDIUM Coding Problem | CodeTikki