CT33081

Faye's segments Reckoning

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Deep in the port of Emberfall, Faye studies rows of segments entries. One clean number will settle the guild's oldest argument. 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 <= 2198; 0 <= a[i] <= 1000000000.

Example 1:

Input: 447 222 146838679 625587361 716910466 438455178 137588476 266329488 436702456 767089039 328744799 271615983 528676150 126618251 551356054 40860931 708146916 592148055 112475455 978273907 429663296 638483572 896362517 227965463 132153191 907354330 529963589 695098481 549211807 831228597 171601676 129163716 980355756 836991248 153670138 65930551 611170189 168288041 14594922 686233279 278182690 466399691 48927758 982618511 997478367 43540919 461009739 451381591 711698260 735118715 564902775 734474043 859638345 93598014 880953668 643101182 966855696 486897598 749084206 355770845 80851467 868597645 706931025 56359353 77419700 843038674 317058392 256443201 692895709 496765568 502218316 346856047 727179664 906549398 313738477 893951499 955492864 808291626 591534014 774110296 889727180 816054372 8…
Output: 107185985115

Example 2:

Input: 919 558 162987753 352052530 278411402 34592298 973132162 557137202 297216010 285967646 201178777 224095892 188956614 213774118 563114781 130798603 831615365 954688697 878538855 951522235 562812635 497584388 282887964 442754839 675068234 187766281 644667739 585605396 642058651 110766454 560862997 52390929 252102868 54220256 89793206 20402334 880696124 6885323 970640755 758900819 389126552 358659678 16262020 691933433 844951598 669685942 700308429 353260686 735337487 186401407 625288114 947620520 460025926 451455104 767441930 997945364 145013957 719533114 166381064 116135839 356010391 405397479 840321575 962925995 391837379 429398950 446490634 45234286 881886579 164497158 184157688 173853724 449462349 175190004 980984143 31469 16346126 458831191 690428116 605668583 68204428 890190977 5870435…
Output: 266070983088

Example 3:

Input: 1247 602 656288480 267569941 964765252 519814241 775814016 488188991 296170229 804723184 608733620 986451678 25689783 294136920 529740524 504063522 959090215 77497061 29139276 588578122 911205630 266690020 528087322 829313578 444256309 459728237 199268635 829130335 66375073 33413251 982933016 666673798 60158341 703500482 969562139 323262864 332751263 853295711 34019224 425586181 5241935 162431816 173230746 121618664 626035735 912155152 399709362 403657956 838262139 413241200 72457930 255694858 222694420 103987971 819070863 200061183 52148966 964389329 719965194 101017839 636165069 397517653 850792836 688272331 693230344 398383685 670506331 845966422 731206549 182202079 51114444 872591254 866279523 711766688 747811394 878572027 576442628 136329706 384213935 783919386 492435559 768806513 998…
Output: 277366768736

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Faye's segments Reckoning - MEDIUM Coding Problem | CodeTikki