CT53731

Last stretches of Dante

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the shale slopes of Greystone pays by the answer, and Dante intends to earn it. First: the full register of stretches. 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 <= 3804; 1 <= a[i] <= 1000000.

Example 1:

Input: 636 494 644240 842801 876669 382177 637637 622819 682765 416821 288201 793710 887945 933581 984015 179142 910194 465718 619587 312417 998720 441221 64139 341196 464926 915495 323450 570542 566039 670978 314397 55946 496701 424371 454632 566462 192939 458304 745010 104964 62407 566983 361102 469011 180057 375283 908289 691991 733389 320339 112033 649536 582895 928306 437459 74119 590190 968561 89649 41691 700357 378504 177197 612249 332304 307827 888304 662356 645116 695300 446739 907242 23359 983569 546407 2088 809305 299097 59644 55662 600736 743194 237246 206583 86902 63274 611887 487568 272127 150647 279945 887523 118173 186329 179508 896337 516196 34216 653868 712492 438265 411622 914671 117128 871598 26945 806428 728178 135015 355086 759820 368983 562221 891561 597962 212655 860246 65…
Output: 236966830

Example 2:

Input: 91 30 585785 123107 809405 863396 998735 480759 576634 873710 265633 567543 877471 413301 997608 180771 265002 48054 710791 634868 810574 381585 307523 258859 893540 679624 999516 617220 356473 149518 301433 567404 668185 402550 233162 217759 564019 517696 554428 954364 643963 381211 264581 38006 498571 588796 928602 827499 306841 694261 309582 461288 476537 20018 99505 827199 260857 168257 373886 698149 114088 133599 756955 950315 425454 333066 223029 444258 620088 499271 783686 555282 246249 608968 907322 657599 272250 450431 379643 710901 591028 379765 174036 221391 317822 709360 847135 620443 838452 85950 457960 200197 631624
Output: 13227459

Example 3:

Input: 2993 1293 622586 60500 87362 111674 599220 117406 179263 131192 690815 206323 323966 927813 849381 784671 339936 668091 582409 319797 507061 664263 909606 883931 81100 235140 567814 305093 145236 486252 200312 167585 235237 312380 658370 486116 438812 414536 23236 878018 190925 36451 361464 325303 123852 247977 558689 40593 127120 127363 218868 44061 680549 716699 878238 560164 737067 407697 566448 229163 917735 985583 159649 144287 892614 530416 957850 157247 983383 700278 37130 783858 659550 151411 473904 36493 795832 994266 776872 220873 310211 666975 930582 234941 523890 187598 501084 96832 230949 480062 997530 224969 254067 991882 80752 453272 29128 208339 529841 105816 621966 972284 6522 215867 564411 441277 489687 995031 695035 773939 515511 319640 192763 647525 495678 938442 465500…
Output: 627379070

Constraints:

1 <= k <= n <= 3804; 1 <= a[i] <= 1000000.

Loading...
Test Cases:No test cases
No test cases available.
Last stretches of Dante - MEDIUM Coding Problem | CodeTikki