CT38511

Faye's registers Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Faye runs the cooperage at the floating docks of Skyharbor. Today the books show a list of registers, and the numbers must be worked out before sundown. Task: For every contiguous window of length k, print the maximum. Input format: First line: n and k. Second line: n integers. Output format: Print n-k+1 maxima space-separated. Constraints: 1 <= k <= n <= 4000; -10^9 <= a[i] <= 10^9.

Example 1:

Input: 1982 1597 191377863 821812738 561369898 61279843 -768683062 224488674 263290976 335609426 559670799 -176968519 305121746 913574046 287360815 -705183749 -992058438 30202510 -122724355 406679435 401184856 921829523 431744756 145790828 421094659 499951355 -15187441 452815941 -316602619 58223594 -571387200 321905087 979245396 139004763 -750204023 -839075767 232045973 -725085193 378630433 -725994651 233690516 -101290961 -234042435 183781750 -271205039 699199391 877248841 932997748 791307906 102071099 -752246783 18193920 527296870 -855529084 -422857694 -544662871 -559909091 753036756 963573776 853519628 -341787294 415108909 127943005 -396065067 -940964166 -688956112 876864634 909790057 247171022 852780626 83369856 881721173 753673130 -433067701 32787300 853275846 -507313522 -641845922 -124287597…
Output: 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 998994167 …

Example 2:

Input: 976 525 -242811954 678489588 -970380530 320018184 905138037 923700402 -372593630 391486383 -970945556 582722272 -594850190 -136901248 -99197353 -698257768 542710268 456566963 250179035 -692368718 -156533904 959143975 71971157 83718235 -464417739 623676573 -917005335 434291857 -79723800 803229630 469841866 819541030 238306020 -35281679 -491403819 889217743 -743945213 -606878150 -869540283 -527254378 -422697984 787244434 348536175 -221482915 -725919283 -927352635 -291295951 226457318 -555635766 257822257 -163292441 -350805204 -311214771 -651861806 673222121 941780510 80635148 87356912 971807928 -6753206 -327208264 -309737131 -211767443 676128289 -622264021 912649149 -424380735 -969914904 -65086396 264877914 266218700 984684468 88757594 -421904472 943968728 -17226824 804246952 -704982875 1619…
Output: 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 999904405 …

Example 3:

Input: 2782 836 -430073930 667378850 -711785152 626107992 838575422 495132053 -769488613 -755848722 427279413 898226127 212663075 -938002877 754364733 -356168818 -698435566 35977257 945125005 -115714931 856212308 -197633522 -224427289 -886562632 615116187 -826702529 -649776243 -784148790 933017649 610336499 149893645 71834745 387250281 265625956 8755514 -865554380 810003082 717077181 -204835230 317039830 -973529432 867965373 241997147 -883977920 9179615 788675219 -709336193 -788172046 89846586 48588715 296090553 -628624319 91633447 46086571 -133488910 -600233399 286082624 1762912 530997536 -865162891 -742137803 429356140 -502063553 351945339 146538096 -518128760 -714773871 818812974 -308126766 740225958 433917337 -684773403 -196519587 547796729 -275683565 -84698968 419413666 -140176591 -408066119…
Output: 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 998601594 …

Constraints:

1 <= k <= n <= 4000; -10^9 <= a[i] <= 10^9.

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