CT64481

Cobbler and the Vermilion marks

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Legend says the vault under the gull cliffs of Screech Point opens only for a perfect tally of marks. Cobbler means to find out. 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: 1132 576 -521909168 -551380328 -999374321 26050599 1701511 -32461189 91295711 -751128978 832765680 -133054508 534678199 -220287431 -269138033 926400598 339619424 -874066142 -649631513 929126704 808056244 -732214854 -394752378 -252701492 -446791791 -337737370 602290941 623211029 -829775478 432662515 533140990 381580963 644820074 -223605015 582710867 -742840664 76657753 -347167058 383102301 -589023227 734783417 -998075083 101330667 -499280148 132274001 -924139319 322979979 -677553909 -305136477 -666424688 92668826 837329517 -935724228 308107335 -137642482 116279950 93680092 461340775 -817686516 -647650206 -922328365 -431388218 -319551538 88881479 -517085120 903758477 577905241 -810669353 939737783 -737191747 -809251462 -449245633 636273871 8717129 -566826366 -874297502 449776252 -679131693 9…
Output: 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 999715930 …

Example 2:

Input: 1535 806 -141019960 -22352728 752067110 77574102 -609303312 904022972 -305637411 289778237 -743485740 -595409419 -897170854 -965447994 484516837 207367595 -4505743 862529926 -124809481 -109390333 449434188 -366293818 9489478 -343770654 -492322945 -752377906 -736690085 39490135 -726104599 643917118 105748953 -386492223 -198792809 -923331024 -645257981 -627872085 551405071 -225038872 4819092 -237560552 -105470470 -894002911 -845102580 -728405525 -698791772 319555163 136915997 -819385926 -851370866 -596520971 461827750 -281117718 628305970 -506512170 262133893 -285225806 -840482069 783975 284229028 348694777 -187994934 -983542242 -588966435 -791789327 -897312572 -528930438 132472150 389604557 514759494 542626920 -631354031 -633202908 523854429 733443033 623353056 -969095893 900967484 98057120…
Output: 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 988625365 …

Example 3:

Input: 699 467 761707849 47845784 -549048450 638324872 159468866 878949258 756341456 287773742 249447656 203648373 -565971322 774526557 -346210108 -577324934 232692049 -848074266 343303390 -684941864 -787283813 124735689 99356156 380614249 898704726 42116870 571253953 209912044 -180047742 302630187 333028065 -183127466 -801522645 718553856 -99004866 163887435 609124571 658833621 339984885 -234640138 495589663 991681992 140507273 -852100384 815835040 121930345 428068569 397406902 -612669321 -591135710 206894008 249260273 971700495 294591022 273481718 671279020 634166372 238983543 -798305178 651140140 405210661 394357875 239436225 -526856825 -42833997 -136166651 -24574003 -961641297 425942032 -7144027 -508786485 960242144 953372096 925338083 791550331 818994216 -926304244 -553923213 -250575586 3923…
Output: 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 997622532 …

Constraints:

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

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