CT36581

The Pale Peak per Window

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the lotus ponds of Tranquil Basin pays by the answer, and Rohan intends to earn it. First: the full register of ledgers. 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: 2948 382 -769263819 467973162 -107492563 485900618 772801542 445551461 -239304580 87299733 255615040 876147238 -983222123 -882972131 283348687 -478755318 -270973652 -214548181 484143084 -944897650 892730121 -258654806 -525076750 211984686 462329056 359985134 521242295 -572273748 120445677 -636176097 -93607892 -287871429 -323862240 -709011769 155419962 -4150781 902627623 -79314933 -381293639 -792516187 114729368 380753699 742936365 -18108273 -334212037 -536661734 -161792142 -348813038 150655636 -893695829 -71517676 172313579 339850020 429018711 -974586641 794156044 -700943641 -672026867 987947649 -679787398 -475763236 556174582 -241992656 761559186 -606065740 -451468966 -222973205 742516517 -73951299 -771340831 -461565637 940843683 561810808 863023004 770324696 -436929185 -502798092 8272338…
Output: 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 990298493 …

Example 2:

Input: 1872 1232 335293311 51269242 -289278607 -109822109 697607655 -906882876 291937742 -975036713 -278511589 -178431779 -645436675 -580595610 -877602870 -427580382 -182105713 -466560428 123907745 805065901 -583164046 -521978172 28208582 -880191069 874525492 -351543002 839343241 999195248 258157607 463835912 943200884 -756698709 957202816 -265811957 525536268 171082392 541583230 210327919 -492291016 -564590608 -930173528 908465918 697284912 682731407 339393561 873362089 -782017428 103746388 889084795 -341231688 -467546555 992442617 261973897 -724275673 -975149264 -277438044 512787540 -476068598 588895564 -286649839 696532499 144118612 817457645 114444230 171536737 126290133 255793961 -772035726 520697134 -40013064 378144213 -809946592 -875920921 440503108 443374231 625536430 840809064 -563112721…
Output: 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999195248 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 999151524 …

Example 3:

Input: 2589 1594 162934299 -753208264 -268470032 -194590036 724367038 355790822 395126132 -811669637 -684514834 -901456362 -801604359 -883957880 200097364 102955894 340804553 -991456265 -948730235 -697711855 -530510160 769500717 196917686 -238947361 495151863 418994261 903829516 943922226 -445481107 -605555974 376599350 321374819 -954122986 -668856021 534271776 97795222 470116084 627484311 -427790071 589118274 -167672706 69885104 728592375 -49034675 -811668266 -737175517 885969928 944009021 699114835 -27274749 870926042 -92715237 -615039779 400869433 691656679 194842093 325032629 85779375 -183382220 756919763 768546411 -712382940 -752930529 170813631 -997069054 -376155221 726252176 -81601199 -787181262 323807484 -206399193 -426228210 -442120825 908164971 -194606235 -116902125 487866508 -933766902…
Output: 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 996781279 …

Constraints:

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

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