CT29201

Wayward stretches Calm Window

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The council of the shipyard of Keelwind pays by the answer, and Galen 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 <= 3392; 1 <= a[i] <= 1000000.

Example 1:

Input: 2816 944 332003 481557 724172 631703 973413 649489 432023 72417 599811 31201 739606 500674 905067 476308 196048 82151 252188 232302 605367 296176 807994 60 646466 160630 795894 257827 831654 885771 869580 949987 30852 746839 700863 350641 191465 38626 288383 789938 373168 611223 503366 963267 795582 598572 983821 274529 546059 489489 491283 740106 600610 13495 226028 11840 61057 455274 282992 88372 304212 395954 545190 671181 171884 892919 474126 45472 38980 659630 440821 530438 810740 698858 836407 391006 67549 949032 171173 325469 300703 837203 419379 813983 535702 538920 720992 319262 940620 746334 210380 704349 437501 128844 723386 378486 78065 743422 568980 9424 799627 659926 285226 1919 279573 409103 918492 695974 331135 14894 663320 954281 191367 953567 177932 246919 599102 83005 23…
Output: 468227879

Example 2:

Input: 200 132 102675 5228 165327 614789 636529 86377 816100 782008 429895 582518 895003 541974 965919 609766 625871 548552 290585 665953 543499 58943 596544 637685 56604 530480 562253 180264 196960 156717 836029 177652 819870 267935 179826 696562 887936 958643 372507 788086 938856 950099 568604 962372 805970 511479 407665 179468 176544 247623 309591 563823 191705 509709 362864 242033 357945 633316 184683 219686 39227 119402 652359 704455 485159 36975 611436 751268 587043 849007 617966 607669 382140 681021 735780 781248 720859 225476 977155 892669 396526 715380 742190 999364 608676 847391 861854 764519 45194 688942 873456 871339 750755 804554 128167 931083 794639 540392 331201 212183 490641 238146 130526 813141 425956 978307 56358 164933 315213 546681 587911 483949 209985 156149 251482 677737 634…
Output: 65050483

Example 3:

Input: 3157 1420 511074 499236 786571 684185 96040 11903 302204 254524 784855 188228 707681 720844 385173 620614 507516 341524 349028 43889 753474 572622 745336 791197 810186 983076 719361 550711 928126 348480 390836 810083 523715 404538 688498 460685 215993 755790 351093 315720 608717 405659 598527 76536 303620 446345 761160 323987 488511 66490 429276 523997 248900 746398 585439 501258 745032 369041 50216 743025 383789 923185 877085 736897 700267 917898 246634 124133 995525 576509 760834 844994 459350 717700 50427 180313 567958 733104 486667 311117 816680 753522 192061 346101 789923 513284 51623 358616 42929 743599 87831 610673 663885 107566 99756 396785 945930 897079 628722 451741 838369 671521 72710 305194 38042 79577 784140 397196 674636 290005 419891 16433 397275 932063 656653 272663 731877 …
Output: 692978817

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Wayward stretches Calm Window - MEDIUM Coding Problem | CodeTikki