CT59587

Elio's signals Peak per Window

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

The harbor bell rings at the temple city of Sunspire; Elio weighs the day's signals manifests and starts the calculations. 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: 1739 155 -579525434 466155435 -570033152 46840105 980807021 630778936 495523738 -786463881 -199880194 -367686221 200874182 -795527226 227584395 -684709558 -58420199 566003094 654735376 -605974206 -575239985 990005397 249453986 -1223019 120658223 719626188 -925231575 -701257053 -157449453 184050963 -449939173 467330280 799864567 -193460300 933595697 -467953840 -683863298 166707520 710645253 -640557092 170745441 -814313899 -4471026 835639512 -779061551 -461885668 -947809254 790617203 -570592897 543355047 785566877 -822797042 794668823 359211614 93968356 -401038041 482914416 301663909 772570195 -460051803 -872293197 -671272209 -525027320 469715694 209752250 -390409751 506742964 6617277 448204316 -781267284 912674974 841390450 -46675589 964340871 584495597 -958426708 -130980133 934044234 32588…
Output: 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 997392254 …

Example 2:

Input: 3746 2712 873556311 110745983 166804674 -938991173 802948738 771301850 792101084 586008546 996069646 -319769836 -935063284 817822485 -741333711 400007710 -348291147 542978540 -759742379 -544779949 -570195433 472764493 618907949 -208501060 -792057529 -662777002 -929884477 -251032556 955480760 -824267428 -769677596 -631142463 -51441978 -881365331 148810745 148088740 935348908 -784349743 -875363111 -101788053 -106160067 520307395 214840716 -76535055 -265975835 3648026 303541615 -440462663 484605628 -574721196 -384101590 218041124 116006416 -646400098 824644702 -341448577 -330517403 121044188 215323955 -985033643 663573400 -695630169 803228182 760386805 197069534 -217118753 911829365 -389290729 202590445 -548893722 -933161931 555863802 -529250479 -277993967 19577179 61661409 -943191712 -435428…
Output: 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 998809028 …

Example 3:

Input: 3520 3407 68942344 620282561 791920491 -122407656 -887516264 -627825779 -910102208 -351617755 -867737188 177497753 -693678192 195265290 -84641532 347155223 762988398 330305352 228656453 884960162 -847029867 139479168 109494954 444750146 -698492535 -85791283 -580864866 -219680472 126573286 -611947267 504167672 968796346 -316131786 619831380 -919872020 -169173117 -141703094 -766780824 -980697059 593803789 -642142711 282326175 -487716348 160989552 738041938 304940663 -204798540 683450760 176351792 301863947 -650766918 281141363 -496509456 -506110133 218114216 436958555 -217530928 345035781 180869351 8294591 351489150 -346851003 -756763803 -630779364 735385148 -556477356 -733751612 91358065 429914287 552721801 -87921226 709703753 -730433308 -307086372 199616439 984955723 -217333153 306016516 -…
Output: 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 998525313 …

Constraints:

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

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