CT61455

Harish's Ledger of signals

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

It is audit day at the seal rocks of Barking Cove. Harish spreads the signals records across the table and picks up a sharp pencil. 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: 2530 2030 837835357 -140726786 -921804116 153355134 133060232 -667324723 525871580 780142666 -696252114 429376962 -591305870 -265159453 -99514358 -504706859 222468753 -725261410 740137531 758633295 -96395820 957281430 -314914550 -292546592 184891028 -431740756 382378893 -711727047 -884697756 315252411 -892423478 224181647 -710301768 880322540 425444235 452532343 -949517527 227261056 -876033655 -304771865 -236928673 -593496720 -104565970 972300403 599758990 -832462723 -48016942 -895623552 -466938765 -669474589 -145509250 478273724 -512701359 -804009811 867104378 58709124 816188453 631100277 -845968838 842488797 914989822 -973372176 -23785511 -757923281 657915943 310241746 207722595 -145828632 766815741 748738400 394892095 -808316970 -789994471 -338901593 579619858 414393986 706025683 663255…
Output: 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 999268044 …

Example 2:

Input: 3741 3161 -139985427 557498282 -517965968 -72214149 102542503 691989787 452112197 312910514 -306270497 -278120101 -511920615 20101451 -245765 524279970 917585748 21137545 790629854 -724754012 -419274657 469863326 145525433 884281649 -292835483 953369906 -788447099 811727632 -579480678 -351581217 659584948 989243374 -48956229 -508489486 176068022 23686295 791523229 372160387 -28184174 -394919305 -296706011 47956307 -181146583 -529166833 -37790028 -122974389 -2170630 -635081986 -645086262 807743969 446768752 -872812637 -922953134 622995749 293017321 -173238063 -110027974 -139788651 922789437 897049714 775524397 299660834 -671302781 107990525 61097229 -736526548 -310505072 -442919246 -128101137 434005072 979697115 -212127322 -425086335 809982354 -677546816 -884644620 -956235318 -928892665 648…
Output: 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 999963917 …

Example 3:

Input: 2803 1326 -186210592 127237570 45472470 -668051813 -416181346 -246797974 -607091669 551878162 -32328900 -515562518 -270152866 -631114109 -534360203 853434247 -993200282 144093786 666530894 461697500 589080189 242664586 69812613 877624295 980154472 -663043294 683298313 768060334 464725062 805907275 -677284701 900669161 4756358 -201774250 -724478766 323165461 180302955 -902915118 -278599134 247466913 676752762 1977382 740359341 -305017736 -776098067 492041500 92347909 -24623123 -318705129 10681718 415793089 253401745 481222132 -479295736 -942969253 -37318576 -822522976 -564942201 893336514 -717208252 278572654 -298309716 797444414 739993447 -929161352 -415411118 -115195053 -308305825 879959482 -717388653 119523466 813150984 -655865425 408295707 -397036230 -843106593 -954642826 -832599923 -38…
Output: 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 998953915 …

Constraints:

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

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