CT61866

The Peak per Window of Bramblecourt

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

The council of the thorn maze of Bramblecourt pays by the answer, and Emir 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: 2893 685 549703435 486670069 70763698 58909816 -566137603 623813350 100782512 -756291584 187290090 -32475829 -620629635 -412597411 -1750459 -243574350 851971170 -508620982 -40684278 667428191 720851577 -806033290 915315701 692270682 -324275544 -371749322 9672407 752393112 -630904029 -428228674 -490589962 889605356 207964806 -534844810 37391342 -749835406 -128947483 921143314 994383229 -489528877 265387334 -539234053 -712677000 -202824060 836916111 -464965410 901726139 296113478 -623002683 -593079952 496925530 -462904447 -996033392 -201789023 -165121927 546211513 554529702 556445303 -496728836 -410059553 -965811733 193606300 918834735 954150585 -459971609 191061989 130258507 -567892913 829432969 -474133523 989513104 193878296 -546186311 878370436 -399575443 856535255 990004266 959401870 -49…
Output: 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 999012912 …

Example 2:

Input: 2391 1647 -234475660 291526939 255607461 403805680 -726016668 107563130 -276424933 -950805535 450117371 -393923595 663770280 -515727491 533540675 -913579773 -135940890 -682788328 -472266573 -275515080 493995187 708147482 710879705 -513038808 -601090653 -187834151 -851640054 -226413262 -388191761 930521822 844230403 377501468 -824615396 685749498 558218499 -916607190 -59999002 725287029 -539175570 -219454658 11983126 250608017 -72495244 -96267635 951812379 -374221342 -627027780 38804828 -846410020 -554847274 939820483 -228304604 -345246786 -347477532 369388413 -118370137 638720674 431373553 -650562128 564289588 781347629 479865273 -243088169 939709780 88173853 136120758 -447352718 311740825 605639538 303563422 -186462408 -454892827 -355468321 76615676 -655787074 -454398245 -644566202 -26686…
Output: 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 999020392 …

Example 3:

Input: 1318 852 -937412328 350286432 -19023836 -612942593 573326628 910244975 901482044 899478490 357412491 169653739 334228346 -828673625 -534213326 -655525314 764952241 -867587624 995172621 893784403 563557038 -981840124 806666826 276138399 640444815 914938689 606811251 413321042 62197912 674808208 628235120 -747546797 -470681281 281480949 728070799 -303811911 982722112 -205913319 -773763106 -201984978 -294302042 153272716 351801000 -347018601 40416740 179168939 272629692 510007232 64836462 -104038409 -557015279 297858143 64853819 828123405 -850502338 -310674709 937101649 -556619288 519210080 -430993866 634787175 -404351626 -88972754 -717503796 -172259725 -890897897 -494112354 -700140950 550428063 -569257268 -259488494 -612218576 304372023 -38776146 697026088 325279325 93105599 96913326 -842031…
Output: 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 999223043 …

Constraints:

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

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