CT63948

The Verdant Peak per Window

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Minstrel the inventory keeper watches over the port of Emberfall's stores of registers. A careful computation stands between order and chaos. 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: 1489 725 238789182 900685116 818924035 -809613582 -395620469 -38093887 -345610960 607431286 581088682 -291805779 -612810966 790016843 -585908059 -874325234 -260494336 249651681 -850180726 571209998 -557481024 -832749505 -673728201 -52323456 -53105904 367611342 28939248 -962376941 -243693083 444673063 -787218272 -929475763 954188634 62713829 223100082 71033529 -607906826 479662284 -199778172 619693939 688542065 575645857 -758560543 444957349 470766257 -161801165 201492691 -797651166 -224072051 62633875 -847960423 11556569 32276938 594314528 -441643871 -123588446 745733332 754581855 678187832 757982154 440860751 -719034637 -208995402 546330418 297694540 -401425104 -715008653 -888314862 -179832593 -785767766 798420203 188851441 651336584 -611326158 -427127331 467120782 -904333487 486791512 -4…
Output: 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 996235203 …

Example 2:

Input: 1185 546 996361972 80116013 200960082 211458324 -498409845 -928786318 -520578538 589107862 486307355 -937140669 53330248 -571473223 -19273127 180880824 -506848514 640066737 697976531 234643425 -948790187 -570870277 -185319781 217475101 351179430 -861277152 72391468 744839899 555187961 -544353093 -577941775 170513577 -311832354 -162865699 -57458242 -377869222 -67076371 976895777 589001292 -201268216 876190932 -537512590 -502338835 -359491880 917494857 492858977 -404278036 642146616 -648623151 617991459 388851832 681091996 -283614609 -301038618 848272295 312601141 -500019152 321140937 -469784216 -514025119 695581023 247712233 550521465 503266405 -53022176 -402712734 -270747948 -67049804 931376371 786707112 3365698 387009159 -268115698 -999694040 511989536 803373865 12953167 -375297380 402932…
Output: 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 999449294 …

Example 3:

Input: 3706 2293 -19132219 -538086591 764821019 794496519 163205438 -869456456 -444045905 30760018 -270158371 -769603449 -284755763 593045971 -492663745 943670388 -501073584 143308850 -166611182 722800237 -801048463 -632604272 952204016 -692976439 847763164 700162193 -251984616 -893305391 415384907 -495409648 143996147 964826174 449151350 -831936659 903641356 -522629602 663093591 657700826 -886573689 -689802875 836726103 938950700 -793457187 52489220 -620338940 -669755971 -290839846 -207722103 -929513562 423093686 -480600446 724449444 -533671543 -593334223 990518143 247643515 525953113 -803996768 -332770927 -350709776 -191686985 551046141 271839560 -785015199 719176890 283941770 381936158 -328020573 -965464512 244508883 -881566982 -166006468 -967545046 -741369273 -538326358 815757640 802042008 52…
Output: 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 998271717 …

Constraints:

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

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