CT44490

The Fungaldeep Fixed Window Peak

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Morning light hits the mushroom groves of Fungaldeep as Nico unrolls the day's manifest of panels. The tally will decide the next shipment. Task: Print the maximum sum of any contiguous subarray of length exactly k. Input format: First line: n and k. Second line: n integers. Output format: Print the maximum window sum. Constraints: 1 <= k <= n <= 1718; 0 <= a[i] <= 1000000000.

Example 1:

Input: 105 25 303083431 585973079 943865864 960833189 20421720 643033369 713921953 758586226 197594972 530557943 528864394 271610693 623059900 180085187 450736922 508379355 657524075 994437804 986789931 844572210 28320159 678595925 572916488 44073868 608287927 26572325 705979578 849762636 237176572 322389077 817620125 305404446 694595660 742196832 248356831 608325971 875142565 881864816 353346901 291513639 678569519 44554873 558622427 490042576 756776035 382907864 463213209 111089440 564674553 771986767 741733862 64057895 289049346 655434544 39967213 114301582 795671528 131268942 841921981 71438738 936443196 744104043 665660213 346274199 879776099 48154049 326391975 990186704 363338573 684091379 724537824 315343002 743648830 330146980 980975785 720541716 591603604 638916416 960380213 934315640 57…
Output: 15984613874

Example 2:

Input: 1139 892 520292561 543317331 597813343 447596344 259241036 646538103 198843092 314315968 560221104 124875016 468194048 81087328 589340156 463389698 982608427 209528747 174409554 671054136 890831521 271711236 304877716 386148200 592908411 266315457 565759241 612004103 759378815 221485920 836282189 428769264 666557491 886538994 459875908 645531589 394574054 229633047 983825068 189174599 73587115 622967435 889538154 225391144 77552175 434483244 336913634 880445927 823973700 944870081 394633939 168209679 312692031 480904115 569532412 502914485 812976682 97837525 10098868 40265719 415041483 395913550 438888559 564331846 200840085 197668133 774205084 134840939 56962233 186159249 733799574 23966320 62974456 647665330 260897880 402152827 613239165 474063594 760827736 86692756 383167318 794004613 4…
Output: 448446921157

Example 3:

Input: 1569 1313 872970116 607074033 645984590 263900289 163673054 164379052 469220651 993985959 73457293 556648149 291258343 996498061 16739806 689815494 26857891 483714426 104220689 551115183 962401134 500973888 795837063 663442028 842015483 684597812 188866497 692805216 600347806 283241514 517468019 871595980 620281704 126675216 512136931 736861102 573900000 937221574 43438309 611359661 187474649 182819214 648060125 437628950 729253105 933665264 186559767 725010991 24930137 794073965 791034646 154737260 30380855 562636778 465602559 396740290 296574671 963684031 779223570 384445279 948121886 711465323 556487220 348511457 412705713 217083130 596474834 359552093 289064934 569561172 150592926 593324861 880999768 99423186 305698931 491707976 838087493 274169294 312600744 984421826 626326172 3299668…
Output: 670754667774

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Fungaldeep Fixed Window Peak - MEDIUM Coding Problem | CodeTikki