CT51399

Theo's Ledger of signals

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the thorn maze of Bramblecourt; Theo weighs the day's signals manifests and starts the calculations. 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: 1166 1088 626518572 331676598 -793649854 185807533 -358181354 -308067189 639093193 -47805235 177492122 435319666 -197628611 519102237 292683914 -269808501 -286242766 789155058 10371337 -154068943 -468082281 133774004 478990543 -858546022 -679249648 -695135315 -266842323 155308413 18631261 -684981196 -764804727 -175126026 -47510387 25665667 -639406211 -336418173 -38393225 -534667824 -148849674 -266368854 -34603179 -554046047 843497981 -768693794 -17884686 52733014 -886740910 -455963479 158845062 -916239007 261799112 581491567 453570975 110688260 312851265 -187071322 -517859099 -978579824 -838798711 534574958 -918621731 -493801123 -754833747 -470845472 -739707481 209846794 -709157503 -919852760 303857284 491941051 -537081086 958365696 -916818714 462359744 -558902362 339887512 -198186522 -794…
Output: 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480 996067480

Example 2:

Input: 3876 1107 461808950 -274763074 444707166 728501795 -853726394 -739131531 -913410960 345560211 513811640 96524242 449395763 -659705855 729902486 421790691 -624407355 -485429865 169025160 505883894 -844923463 385503501 -517655152 -308669716 -934636784 -893547394 -297221094 720738886 551436450 709321182 -714149087 -522168979 839433113 -61257439 300242483 630685652 383551421 -44971298 -634336364 -920927378 138496008 -265714633 589079917 872828769 -951080761 -543398228 424495303 365837343 -586912025 -228437583 -103531635 396500608 316032977 -9241655 -939769299 465426186 898757456 481402973 740495342 127771582 -965805022 -93182749 -807160436 561958919 -288277540 375979960 141454102 385293223 923203932 -954503651 -908494860 225648605 -419948544 448396854 82533101 -606584366 958439824 -929675464 3…
Output: 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 996976947 …

Example 3:

Input: 2706 1583 39735316 -170201391 -43704073 -402330504 -614803269 967404527 866998321 -77728791 731300847 -661462545 -6581419 -918862960 -603307699 -949196290 301051150 -214989568 -725937669 -866676574 -108455319 -608588951 269599202 -866686262 984956751 -705427012 5950499 -887985028 -359028053 -775775570 -871163174 -204603791 -672180950 -782507452 118420248 26305562 78096711 -358271566 -638525264 -981653978 753901100 683014493 97507172 699011536 886350237 740250499 -195381342 -241215505 -571096519 650279606 -130153610 -111480695 260645454 -355059259 -190668999 -37426584 -9283930 861863692 636942283 922893775 228912432 569682545 -126730200 -889543806 -28150667 -647637892 290645517 -429311556 27688253 -518535715 -523035364 -49007555 -934967648 -396097374 -242159565 -143580098 -152686037 6483615…
Output: 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 999648048 …

Constraints:

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

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