CT62089

Yami's beacons Peak per Window

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

The harbor bell rings at the cliffside roost of Stormrest; Yami weighs the day's beacons 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: 2557 1158 334720055 -59958727 -689187301 928640061 385195618 -672164567 -439391170 707853755 309641285 -226210789 917180676 -368114107 409529548 380105593 593476051 369780657 714816657 484444207 822743243 -926318359 -332115560 -666323960 -28540364 313749510 -50351622 519332661 -911281161 970187888 910288450 -970752657 -530113739 452260245 -778491412 732363371 -971115010 -399277748 477523752 195100620 -212851371 869127659 -548035921 263811736 308565625 -242681926 360703178 -696304409 104761680 -439001875 844100901 -939816746 779053815 744524563 -422957408 -704272850 -138034272 -198854405 -266720190 -125216045 -847376619 -957832970 314660664 758756121 -819607313 -746422763 -853292281 662658583 924193412 938266562 -554517475 589863122 -901568012 682917354 -677060725 -359708050 -142566447 8995…
Output: 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 998644947 …

Example 2:

Input: 816 571 478886273 814616917 745840301 -123695958 -51333550 578528703 -469550552 774199793 -280846486 91196276 -541700011 -389662567 -935553944 187584325 209545878 669766775 -721444214 607659642 -87379067 892434253 -3451375 -460713682 37539484 514306532 831740206 -569054231 -83782316 341996959 246323935 -589059825 -509602335 531395139 -755246550 -119002824 -459643880 -457451168 -792065736 -921381057 -765446707 -760263696 -536721332 -433243806 917180895 938626136 791924842 -712253526 -496442985 -597658287 -202265545 392298831 -752303360 -314221957 -810610277 -865314324 -699421804 -339128745 -59735376 189143665 17093164 -616185736 -673353024 -36630110 731763774 -68015381 410281306 504982711 406017257 623158487 522431163 809422345 -626612559 -611404535 138806183 593309740 113978355 131159463 2…
Output: 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 995668397 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 998228631 …

Example 3:

Input: 745 418 728917328 -561680376 -727522216 -49766931 -849008261 473262710 -635259845 999147138 358025904 542565914 -832137718 533715563 107684584 662080787 -141174427 891770096 -36485782 341014985 -459019341 -13859303 -854862876 543560163 23143367 -324329863 961004253 -862460355 500189001 409331705 -592837500 311326632 399671152 546431219 354769548 -138124542 -162037178 32326878 191437773 -249870805 -871800070 -846768779 -536297124 -377965898 -232080195 398873930 -660070843 -637822173 -171827481 -743519976 660084925 551957370 807245809 859041195 -209763612 -211837263 786332866 -664195057 -893823628 24046890 -742015651 760915509 461415290 524912508 -34355173 665358892 381531000 -680381054 -78128729 -801850315 -938523992 -883013170 -148327621 -17063326 201454634 289260063 848754515 -356142740 -…
Output: 999147138 999147138 999147138 999147138 999147138 999147138 999147138 999147138 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 995206291 …

Constraints:

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

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