CT52748

Ranger's Woven Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the caldera rim of Firewatch pays by the answer, and Ranger intends to earn it. First: the full register of beacons. 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: 455 104 -874665361 457457641 944682024 -861976637 395962415 466945431 -303783904 -266726563 -830817460 -672464659 -747406490 -289038758 475918401 -166241902 424631541 961176651 -437572476 87282889 563649442 -418674570 751770319 248143248 -439353619 509679522 618666868 -452842904 293408878 -564656092 585074751 130580466 998182412 -548542575 417711956 627252554 738875517 972870105 699730617 -118047583 -871178196 672250878 686060895 -376478431 868368181 654797689 267191271 -26349709 134978823 -946523760 -262237560 -837393403 4820254 -310551213 476253437 516489853 225132366 286431357 18716907 -503654033 727684068 779775138 274941531 287693962 -72147240 907335655 -784802606 -6839350 462009392 383129340 461842153 109380953 -472943884 421575527 236117019 -378095503 922846960 715475147 857408066 -…
Output: 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 998182412 972870105 972870105 972870105 972870105 972870105 932811520 932811520 932811520 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 968013190 …

Example 2:

Input: 2436 2007 -694054848 -765482232 -620485328 -83559603 -36377486 -970755067 857912371 -814694799 -970506058 -417043862 -249503313 -499849712 -933354096 68605416 903104077 -589215112 711797652 -183948805 208530032 -541237362 -729784275 -624061775 -914433363 780217724 326775471 -484725462 167088260 -659962429 36571320 -718252706 -62662072 334084566 425588584 -174366784 -528807241 217848139 40185092 -793357955 -352909390 38589026 -612095064 -311215738 -481534153 977490284 685370745 849745486 642756402 -570849237 -624825721 -388149134 -439168339 -6088131 994300659 -542321993 770023403 259510195 -341252913 -154255199 267158948 490773558 -300287766 589872222 -160260273 -173715791 -813054250 -513814705 -961410302 -554549498 132659933 -284949728 -225350010 -313033652 221654663 -225622246 -855131794 …
Output: 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 996623899 …

Example 3:

Input: 2913 856 -775506564 22788608 462123163 53897110 -912029446 -993008838 -389949640 535720854 42981458 103855951 9720644 -585605999 434894569 114059009 -321019127 -285436647 -383563127 476212242 -592748065 616284597 -958884377 -999272127 -802458140 -983755489 226533687 -29302286 -910421726 278027274 893891917 -767275367 464771756 477739302 58512982 -748398265 -557149546 682991999 -627502216 -30520432 -804251209 -634367015 885464956 -255774930 691890293 -426513692 -815459183 548623155 77426696 -941976210 532321976 455914983 -789697726 -401151583 -38446461 -425045396 -397332564 -369905236 -705199062 -647725552 823459470 -669062049 526422551 394068389 -897774912 969483287 -486621448 -195436898 261235985 -559725549 820706063 418749188 -201580418 575086461 -528770672 583030293 -192658926 -86768258…
Output: 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 995392248 …

Constraints:

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

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