CT41951

Xavi and the Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

At the salmon ladder of Rushing Falls, Xavi records each windows in a worn leather ledger. The guild wants answers, not guesses. 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 <= 1065; 0 <= a[i] <= 1000000000.

Example 1:

Input: 570 343 491240469 836868978 480190599 769917954 866461733 834627898 129943081 24823340 287272674 213956275 682788483 949985435 645860714 175571371 844681011 236952782 385593820 678150449 207726444 354402539 383951806 9657687 418052441 638944677 154901330 332209724 313854608 672584935 559967502 596190255 838627348 117469937 602259639 3188464 635976572 38090119 502620410 831449578 193734145 497627899 217400121 739294105 899289424 886730355 948055187 725472383 81247369 211443868 605420005 487553546 567971640 988494363 590930887 698351866 581254994 658620211 292276614 806133830 886630523 718439599 982207330 81526891 778981314 315113105 849345894 49660918 241413051 764515674 925228606 547785586 812593159 631165861 295134798 290946533 408699935 131049900 481201741 685034045 465766566 72434127 84…
Output: 178521413386

Example 2:

Input: 483 435 83201244 636847513 583025825 382762897 163074289 543232679 967951854 535581276 588642203 588856080 630691483 68809415 688432048 584628674 469641900 609338496 141950516 189711246 528680018 38666198 885040346 131082673 675477656 728442148 476357734 535290776 377678711 347332314 814452198 637987006 908773969 959676280 102584329 109962843 219356467 310646452 250766552 987496757 27895306 612630394 702611144 412449260 508061640 557340836 347262308 897688139 203169612 352898447 89899681 846009406 536020673 729645533 684620572 281468082 4639828 601270515 357247360 990534318 208797678 526958263 579586375 10788153 705991124 767001675 325800334 494841182 95080488 367058431 444631601 408324491 641597115 481041881 235447062 930004642 361085066 723340141 681590870 431848061 530134412 33781783 81…
Output: 212137108762

Example 3:

Input: 485 205 268383528 440287591 978677581 423395935 715450441 811538426 954613596 984290175 372749373 39265342 255094983 4396201 278598517 696646633 647278995 982980375 916299736 842774653 920372879 37879261 799410428 522188982 603035132 600652119 869427105 162472829 466938831 370012190 626678524 443708728 40337695 558028368 863774662 963144927 903719055 142603984 465320279 753487508 294625141 449787120 299887121 29136678 553229416 544625458 345555926 811792475 18089012 847555891 631708849 675616780 724982216 516524567 94137914 625452647 205326652 271782913 808417311 592703410 311878157 868717021 28368347 846869490 961076582 579375857 703952934 930842094 564316511 392549967 437571207 90353357 547321590 190916496 581947451 823849459 396148896 701375463 839971552 590732672 975670374 643938669 53…
Output: 101806046972

Constraints:

1 <= k <= n <= 1065; 0 <= a[i] <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
Xavi and the Calm Window - MEDIUM Coding Problem | CodeTikki