CT58895

The Bronze signals of Seth

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

The council of the smokehouses of Brineport pays by the answer, and Seth 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: 1900 1304 196481746 780801677 77145108 -557019693 568245086 -642920880 -495283581 519390503 664513193 897320440 523834938 960735550 132736780 -21613634 -576747538 -230927426 -556252879 -67353831 -328763284 176126051 -581116678 509691499 -755315431 -285314791 -188586234 -511979180 843068577 -974330790 -783094411 -801113668 773481157 -616288670 -504925638 177141358 112883944 696305134 -455807238 -505843874 -48275842 -808402843 813379747 947985480 616902821 -817116765 539819562 -213347582 991436187 964673782 -428499780 310155660 -525521859 -155331622 197629815 -446065066 490797007 786286333 952471556 649096583 468667370 -263580586 -19516844 995842201 342824185 772651057 -811638367 901916767 -468328327 503317149 -113196754 70140664 -651288480 46239899 56278542 -462635711 887643839 -899688591 9…
Output: 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 999661846 …

Example 2:

Input: 1156 931 969418309 -167459424 -862650034 97277903 162765025 380334490 571029286 807288129 50853803 -118581122 424896179 892301637 469250117 417102954 -738614592 -418578466 -520330542 815830294 15611236 -411720187 -888177746 -531805579 -513590473 509748018 -953685476 -634496714 189379035 880033941 -661093772 -678142111 845722891 -492874766 -34417642 459277298 -227512495 889282363 -236799317 -831413872 294094874 770554305 -668049077 -713437715 -901219482 58554182 181557810 470278201 136982932 -577644478 -634901088 594726370 -519743606 -558806407 355759265 -89986287 -48160027 883377462 972249504 954871292 -878132860 -482127100 944823187 -672683189 -845998548 -656205190 897736558 -402136510 -318165249 -930024407 -233138241 477712393 739589354 86845545 -426344000 -88790408 -460444642 676820490 …
Output: 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 995327840 …

Example 3:

Input: 2622 426 725249807 922851922 -283811647 447714158 194800736 845754330 959439649 -548014274 340626849 -993522160 -282419642 -450057018 986734452 111762267 -729017049 -790346893 -998812214 545053559 -915360021 -111702913 408832589 893595170 360427638 898551654 381092715 -493678711 843555218 882016833 -803219317 -525606829 -159312640 -347059203 -85854409 -671344684 985054801 -914395579 155612388 523813011 131182438 -981675713 556914309 336848623 563272889 -989278131 313811707 -154030986 -899173335 -22136386 808180203 -224408566 -673187394 -193562043 642080986 -700056789 -106933111 206081290 506867064 789903237 766277544 61093216 -70965016 431114389 -168831759 -144617681 235495981 -601489996 -578003722 879449394 632555843 -396004583 -761838033 357453698 108259394 -50164742 3362194 -118745077 -…
Output: 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 988622553 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 996591025 …

Constraints:

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

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