CT37213

The Ember ribbons of Zoya

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the foggy moor of Greyfen. Zoya spreads the ribbons records across the table and picks up a sharp pencil. 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 <= 1393; 1 <= a[i] <= 1000000000.

Example 1:

Input: 1260 929 961119882 613449657 919904710 727449254 904180560 349398464 10375039 850111991 496429323 590072227 672318253 400889700 249165009 719335745 201347210 919952027 30557989 221848444 396463724 188834507 932339324 716700465 471136263 698565066 312530445 115774948 640403516 279909776 167494015 253362069 409647140 896551586 395923984 210353027 104518951 222637970 235031476 319937133 702372429 236707549 124640483 610680067 429035535 573167553 190243654 388230363 392433984 642405812 62908078 379320202 254107667 182117767 866339856 690650198 928722545 626519774 349222009 223820750 911094682 53000798 331373624 805919526 341392530 519607207 104567330 963651334 500976632 955380852 187947238 190570 629542011 578014964 669767545 737290043 636997367 321314254 6286278 769032400 625453423 227881479 …
Output: 462499264691

Example 2:

Input: 1269 711 825514930 771181103 186098178 528095143 379728363 392778291 567636591 530403364 158342960 495863748 698722381 941059927 574872777 184123057 823218132 501136637 104231727 332800150 269980880 109602605 231687793 709988125 431957162 981902356 128702055 942908289 78759910 180815818 85361279 217437173 582472269 295183212 341454890 305612718 247670158 356303311 670911885 59797012 154405366 445158800 299913668 468179216 299362696 772643590 468506780 802201004 101932459 388298 553550776 773177881 527960618 617942683 232955549 91425498 497017905 735383663 873802930 908351883 984100940 58961167 894038036 911043578 470791453 50645300 751461676 244187164 580108875 820974393 585479192 945913381 860538489 158903854 130936550 89269466 627939234 752303205 717114343 598080383 765250052 306260921 2…
Output: 345261666039

Example 3:

Input: 322 189 447297376 396098487 570917325 284163010 659429587 522936297 329323086 340162292 866073924 916587238 736788259 559741302 9613247 288101275 494446524 910798634 929104370 959738589 495013870 447021657 648866601 26692458 74390750 697118267 523190303 574978442 552552809 517188506 18083991 564263096 419362502 749688092 247248793 880509089 710024887 588387726 835703407 564126484 948305693 216885961 416715779 615772676 91250725 419073730 299951000 151582081 320719662 407425419 306455543 416949350 598043323 787396184 957517455 918238738 124290620 283747646 287018088 579341841 712397156 142717493 794746706 368038598 133850764 107230739 120287694 940527447 273472565 511803638 343998386 797803874 754735486 972900129 746528064 154479660 768968575 332418327 743505204 316030459 221516716 60111717…
Output: 88500810321

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Ember ribbons of Zoya - MEDIUM Coding Problem | CodeTikki