CT48971

The Polished signals of Axel

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The surveyor Axel has been asked to decode the foreman's shorthand notes. On the desk lies a long table of signals readings. 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: 2570 2111 717202098 276003852 173615439 -621874739 -166851922 478700849 210067864 -514800284 870655506 -894950714 742421666 225543647 -62813846 -677235834 -427015378 -840236286 -256429886 -148989799 -669010626 -288039937 -361538506 -969907198 -149584058 398466019 789216370 -570616018 13648372 -209988702 453869318 -546939074 437957655 792452037 -967614571 -587995945 240868211 889151191 -669164870 -960216588 -245818453 -675637557 -328744609 947362329 -117346650 -815106883 -139076023 238730986 634959090 -506356826 -60849282 -955924225 -862079295 -90338696 -998371624 -625639692 -366844408 -597950245 213548466 847597761 903880382 -972499035 -770453647 -264452878 -320952304 -58549478 518495398 36568771 -629788487 -161520168 -778721099 -639271599 197439895 889021804 403610909 185826730 -212819342…
Output: 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 999683222 …

Example 2:

Input: 1334 799 -179224010 328762509 -604560087 -3120308 -552498518 -825135430 -216800476 -327069793 -664256526 117182220 620791895 -633874498 179267175 780809318 77182986 161822266 944911828 810332683 148708193 661710014 179328593 353207352 -961313356 -341333793 922791105 -350243164 931523904 -3186720 -925934853 327257972 715521997 -162417123 36644652 -286320231 288272074 -166294393 -87288728 436821055 -970099675 -937982909 759589692 56476792 613330823 -833998434 -967320406 -897299142 -577228312 348068639 597178189 822538438 764398720 991451681 -303864181 344108022 609885699 -989098436 237570257 -356231478 -537579078 395649096 -989122458 -300773447 -134476999 -289763066 -962480735 -977046810 338443880 376588562 -358562904 -207092347 -200997210 -497045515 -668712227 703553107 148552011 -960888919…
Output: 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 997724782 …

Example 3:

Input: 2094 562 511140123 -776108080 859095102 -501890177 -819859887 983487235 747950584 943378684 -944229687 390047971 -462930657 -622925748 291271191 -17608345 438400552 922696844 614981573 -338828862 333578881 -754917453 748115152 760002441 65683277 -89334228 933395533 -369218317 -682106915 615756159 -623441524 -370679974 -847407748 -684992489 937995814 75133934 313503461 862792615 60631961 -101792789 -903142344 481957880 -804347102 -776439307 301395670 90937412 -925507237 862616245 786678497 808261510 -919003989 505797229 -736635506 -821195370 952965189 -90913649 -953736770 -141624811 231986192 -784260928 94349671 -597539340 -421744329 -739512414 -648602838 281207705 -285130524 -690330834 -100707759 206959032 -384876134 -400131284 -6201792 -998677041 941761109 -558029436 -308226958 333086676 …
Output: 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 998782436 …

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Polished signals of Axel - MEDIUM Coding Problem | CodeTikki