CT65251

Baron's Honeyed beacons

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Caravans arrive at the eel marshes of Slitherwick with crates of beacons, and Baron the valuer must account for every last one. 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: 2082 200 646576315 -662468172 -338586504 -792616804 256363874 93149543 858708812 -369419998 233232523 958418375 -548274513 920686421 28496 -570396264 -937289532 -598665689 -595753886 -74660968 718957983 -471158278 -91756914 -38448115 224161031 626010449 -392291368 982966653 -352750405 701951724 -815712420 395692307 -528025919 -446104747 -378073169 -450691918 563442947 489174290 143579563 206595044 -543062711 218943125 -7464582 411622684 912437361 -57682595 983929096 -12906891 256765541 728219416 -307222692 930406058 -24217764 -503895347 611173308 928761437 693932196 -137795095 811029260 -789701876 515159331 -583230181 -133862082 -218132267 365423420 587016272 624018586 5619292 -710391061 723724770 -187865468 550701373 298504922 -289884345 905898975 -170440238 61881196 204549380 673873118 -…
Output: 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 983929096 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 978375211 …

Example 2:

Input: 1036 969 751967172 406899117 -344042814 91853277 858116279 250528473 80188347 -719065472 -64145988 4875791 -880517337 841015000 -53661560 315237641 -577738961 810445765 -561954664 -150023554 929428411 217716214 117514809 907170594 70072606 -934665348 -242549704 338559333 -426301857 811108401 -284089742 -23660545 150676583 -821523818 -217082865 -153292382 507522574 935081916 -648810547 -858689062 -271038411 -578524924 340888097 240170324 823442482 319658644 -314163627 179379570 -210159178 -362010103 138496554 -756831727 809116378 -476989668 218196247 919566532 -511756267 918564214 949421538 -294651497 -40950514 -483064654 452435972 -8904658 956624571 566674012 239574288 298880166 -682846636 974185139 619627270 522433362 -335045434 738122109 -761537887 -540922627 749423671 812897378 32610012…
Output: 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739 995520739

Example 3:

Input: 640 85 94330172 766281007 725824460 -782718879 -312979320 187777316 -561204328 -698248391 851935368 -531628842 -296666415 -734885311 557589657 469598838 -550754999 639973256 -390164884 708992244 893616816 992434666 529572320 -921230725 -199931905 782806317 779337089 -162365316 12777533 -828599795 435961860 948211181 -21703646 -768702650 -377313028 -765438092 139014400 411611412 336814337 -79201209 -727135415 -474900473 -279447228 200778224 -46506288 -974842944 658334034 854504019 -278414895 423606156 -661003188 870007741 598242507 557210700 -227430055 -100752739 -122766512 -60356394 639936025 788267147 821390753 -195993206 508494114 880635915 -111869605 831713632 655351398 -940334079 -517053992 512766706 35501644 149071227 -559669453 850945390 229370120 787915757 -103893490 -977357806 -656…
Output: 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 992434666 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 968966178 …

Constraints:

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

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