CT41664

Iris and the Calm Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the copper works of Verdigris; Iris weighs the day's ribbons manifests and starts the calculations. 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 <= 3426; 0 <= a[i] <= 1000000000.

Example 1:

Input: 1123 948 611669587 956570875 612330708 601978861 664436481 470766664 862562032 152041778 487914114 886176459 570912220 295171538 110046399 268813941 89142926 174797871 862420057 874075465 249338612 727626457 329140832 179835078 963204553 852616662 337993429 896959712 257330750 967992639 686996580 977549952 119019857 410142339 239488263 936116329 213605291 277680882 415826381 800614635 547120908 225475667 639223654 247176259 95044841 166989020 255694158 163892611 402016235 959491376 424001445 534761848 941994822 788694509 687380930 646039930 751220707 919980938 355415260 922094761 853986910 478261599 993501666 76703953 304928524 211478544 152418225 392315589 114805790 241136211 445695834 533374799 667646686 607959586 20313694 373510475 163806965 507082028 748593592 500312159 607039139 82235…
Output: 473786920597

Example 2:

Input: 930 407 918257782 819860696 151418957 784485927 910984967 265560464 498083962 854618620 320059817 877397085 321416583 480325659 684456543 862553251 997672362 184743647 297746260 152870213 548731421 780775826 35896598 308676378 314590620 525837244 454916964 852581558 734304836 773889751 236896788 580198371 766461879 313755834 691475332 815359408 307705113 372153188 842123633 905998250 769436391 95992228 827156109 608262387 225510126 853578731 445243930 624091064 720292474 164853647 818461951 527426872 489514226 143478511 796068192 939655758 218137744 82748124 179942976 293107699 941397286 859255293 931356140 609197433 258924779 353002729 186091398 526238969 988907401 674666052 841365370 553067433 6540555 91830708 682201485 3753188 38666233 27974087 607211129 453309283 427810740 646521586 15…
Output: 199742838009

Example 3:

Input: 2915 693 244265700 83143970 519874896 175239586 480019715 37214702 847031791 573873878 749367461 137639970 584388464 96710638 547911292 440700282 344757942 5930235 360131294 448927544 927359102 149455116 54468075 837469728 717008783 287107425 225959056 515878405 594782613 858644719 64463894 839630081 253920905 168724427 485074098 777338523 353563573 93206602 85688982 614644187 382941124 767743915 650775524 439546434 930752148 135493395 498589920 969235932 738675904 908453697 547204040 433836457 539258501 849691824 741476452 522011877 707646161 679637876 847909147 235296539 560861575 355853619 11977206 11020431 229429896 221130301 745421282 817912433 748546483 555658878 494943796 293176593 730529811 658742805 410376780 774223371 248356658 642220276 769621522 177220244 954953284 817543673 31…
Output: 340420047297

Constraints:

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

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