CT63866

Tinker Counts the registers

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Tinker runs the chandlery at the lantern reef of Glowtide. 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: 264 142 701526973 986003317 531430213 852671151 -230460239 100702022 97968940 468302793 -213068618 988204445 738991973 915008626 901690628 571744783 961976497 109922793 -273942787 486894200 425063216 985785042 377844519 -912445684 133976152 -256752275 74071580 -751996996 781223028 -655801504 863097846 -972231721 548578135 -444867421 455597225 -266032277 -663086953 112874301 -429409710 -266059370 -516934870 -229009114 744133801 754863695 -132927784 -641075784 -117014459 -469915352 432869581 993125919 -59482758 531916024 848953375 -200285288 -832413944 493954669 849868855 252516720 -931139227 267584870 -484959915 -141407735 346020298 -910163928 251353766 -693190246 -141297465 -736601815 -288200389 -977116216 951024721 -605068148 940561646 30746391 774692369 -60711061 -154256857 -465666294 22…
Output: 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 993125919 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 989900730 …

Example 2:

Input: 1999 1782 396801856 -21332208 333462089 805409938 -643580113 345001722 -296211097 -922324286 -931147687 663776974 -792857531 878075548 -585335823 130565131 -795352744 366083031 431725432 169304538 147652445 -389722730 -168660810 -208440712 721557420 204421309 -845381215 -80863152 -812537425 568605231 642854186 -972205974 376524216 766564633 -581139353 -474594816 636226945 756083822 -186712979 -105529301 -50394644 -174949781 -220796588 687794412 982743327 -639374632 -887058926 416740053 -140038500 78468633 -492348634 -834893833 725369706 832745697 216515572 -775109079 974742423 20135795 984121826 -96800861 995671045 564211397 -150768037 -775512797 -84896800 -308236237 -766256967 -991772892 -576942271 -447424420 -557884819 -8202137 902000567 776802793 180234173 -335368998 -30309599 -22099115…
Output: 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 998932535 …

Example 3:

Input: 1033 515 -709775167 -198202212 929597940 -414916743 -3688811 58717118 -821628 812220895 897167535 -361437791 23883754 798055753 268348445 -24512015 856087520 -32600665 419084313 333068927 231471194 577125011 459369230 -313327818 -157701780 209350609 -762776131 -978956509 -310437609 -409957214 -216437944 239469340 161731361 319703742 -109438485 -544947344 -95755415 303290671 243973973 -996159735 -439409489 557949081 -777646329 -903819206 -130766809 517459051 -192386349 -821148278 337372386 -380740629 -445601316 594865014 592275029 674307590 587867074 -966947727 401069270 664343995 -603235602 -437406605 -554828663 -792080012 234855203 743597036 87367647 -202635701 -811264334 -652599987 938998272 -896992370 267842475 243952864 -439244344 411457779 105365941 -364023818 -673981803 -762044504 11…
Output: 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 983345280 …

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.