CT35983

Last signals of June

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

At the maple sugarbush of Saprun, June records each signals in a worn leather ledger. The guild wants answers, not guesses. 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: 3551 3090 -962074717 431542480 212836727 -129220894 229255648 -247733543 -858921244 -173968056 -846534350 -664184375 -66202173 -807192410 722699696 -382263951 -423164914 283404781 -51866972 -808765939 612931754 830585594 210815477 383046699 135098418 -65638375 -871530651 746103516 926856593 294643916 -780728693 -632424360 -214369085 -602448952 415660572 -491782614 84458485 785166965 137052423 18809983 -784485501 105497398 -696334042 270474537 -950030337 -235308135 4360420 672149093 -208704492 176598944 -322795292 662871996 408755475 347204349 494198794 -944617395 -83609645 -860214557 -70483778 382317649 895939298 244372611 425751794 935565301 -332808280 133933740 -168993626 -810707918 -197122259 479548915 -415112702 -253241459 -448177470 -973743710 -878849535 -440419566 -645808066 87782199…
Output: 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 998727756 …

Example 2:

Input: 588 480 -127442163 220582928 -948817020 -346128600 -923373813 -860909740 -985224416 252117605 778777094 -553562489 -270778999 -639244759 -335569587 996106975 830356713 -929461652 -501195522 -816690393 919108425 339269952 478886943 394919930 -105817167 -534961556 749318600 -657838689 -799387075 -988081319 -119583910 -20596447 867017669 -826237765 -463998214 170279027 -253577314 -570841974 -979054480 891346381 -388603378 582621767 -769642356 578278491 -639279118 -14523007 -581450235 -778027541 194386098 111941875 553363504 637077033 67840055 -996199172 920576049 375201101 329065752 -171016227 385368888 895073935 111650090 -940340633 -946882184 969826551 996050050 -154396562 220826715 -14635782 624246492 -74422458 -890359777 179741771 882643206 -968924101 -210383349 -847652979 -660131040 5440…
Output: 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 999575994 …

Example 3:

Input: 356 62 -902900992 298927720 174027489 -985464854 -509756626 -969221051 -513950638 201309730 -639145125 853761339 -568541600 -678885165 -726139873 -892309263 458089703 -304726297 -250103468 -214240579 -175515221 835349116 -485870384 -414956854 -180273017 -375866563 -842838847 280890260 181868464 -801808306 912403978 -476858908 -253204984 209729926 -892588542 -679052682 836810407 977610232 40484752 293205586 -899129049 216837221 -433795380 597860217 925748900 725767739 -974031174 -123184883 528185096 -210935593 30215668 -503788584 -921822579 670691090 345115901 220441449 640751729 -207789533 126969908 -166561270 -95280756 -613466931 53767467 729754657 927866004 -251212678 -987857450 670593456 -786175840 -504551788 -460323054 120753887 -840821880 559605951 410150919 -429420736 -475015939 -316…
Output: 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 977610232 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 927866004 913636519 913636519 913636519 913636519 913636519 913636519 913636519 913636519 913636519 913636519 913636519 913636519 913636519 913636519 913636519 913636519 913636519 …

Constraints:

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

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