CT62364

Freya's signals Peak per Window

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

The council of the obsidian flows of Blackglass pays by the answer, and Freya intends to earn it. First: the full register of signals. 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: 27 22 -829197491 -842455670 134164455 366845081 -145578298 444819085 -869529759 -944025098 946214233 -400513063 -742668487 -50051115 876081903 -988531636 -586439707 919726632 -821302492 -820517796 -718752974 123889022 771499982 -135803398 -614564615 -831631817 478800445 322257554 166811674
Output: 946214233 946214233 946214233 946214233 946214233 946214233

Example 2:

Input: 493 194 816189695 -647459751 -736369204 86444842 -824416426 233387159 -246253609 -355593429 -982292651 -719905577 103086630 -737325528 560752374 -57785927 -107578516 512512132 -622415328 -809903783 757239785 -53415175 799189572 709710706 -869494769 -349883095 643095284 612418078 206892480 795388986 -64604173 491138535 863089087 -189306209 -174135804 159085225 -407611074 172672753 -602741535 -310721295 -234601799 -324342669 -536767342 -121603371 -973966787 -163167059 865179677 -486570425 -483191987 449984575 -309708856 135297623 -555055115 420050776 624750907 995874091 -789486213 516982364 312039615 400478154 895795882 574257252 -572861497 376643725 -660778631 124534003 974322452 853872999 745018821 -758806260 70347210 -791694783 -211000440 -122261658 398575306 559227501 -971155722 -5997917…
Output: 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 995874091 974322452 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 975812244 …

Example 3:

Input: 1420 618 -787262129 -984186756 -757778955 -374817224 -95642903 930605801 -860049645 41407277 748839158 970207402 362452150 -443716088 878705100 -614540365 17411198 -481867421 -220299337 -848900674 -390214033 -424618515 -47394350 -952285465 -721023879 -61459380 713035800 -534539706 -534020703 947074056 512828954 580221963 72459733 358569980 -870177941 302833087 637094375 -307705714 -734505110 161254008 -615045301 917875991 -880419894 740966049 -297205887 -680016388 150604660 -947440724 -790670418 201311854 -11885309 219355474 -66478761 -46189179 -990061535 522799254 623216876 456714743 451979050 -385827368 34999761 -462322639 -785584505 -617001145 572496155 -694983320 724547890 956796842 78816518 -157002578 -546636270 438094033 -289396631 826866981 -975041172 -844255934 -9147876 193629744 -…
Output: 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 996465921 …

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Freya's signals Peak per Window - MEDIUM Coding Problem | CodeTikki