CT60962

Ulrica Counts the signals

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Ulrica the assayer watches over the singing sands of Echo Dunes's stores of signals. 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: 2702 664 -824989355 335356436 121340206 -824704411 -941996584 -144631266 532898427 193696205 -966634083 -899722459 99016948 750696817 990368992 -154898216 -64674205 93446124 689081603 -962152283 599716096 -431407391 -669442588 206553381 -800865248 923820248 176710047 -738478590 134820274 820689406 -446921473 95618656 45718807 -405874623 128228715 643483481 99267029 180954859 -469516034 -161172076 705172327 -358843483 941384006 818838818 288422233 324524844 349393158 426024183 -334295714 678831865 5821987 725014231 -561524777 876513652 942023278 -124818092 556310970 753610638 150165726 899912012 933436743 849450320 -525903265 839693232 538733604 -834231909 189134449 447175177 -373369193 -285394107 421720050 253960351 -311496352 529175038 -350480973 539525132 156526661 -381961968 35474212 -6…
Output: 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 998440668 …

Example 2:

Input: 768 624 -316086887 366453997 -377569686 884214083 -655701368 -115026953 -815719534 469138095 -11125413 -41832825 882092739 -453861006 -606918755 35914617 -150810820 402345348 -962596746 -154157068 646065142 873640875 -872354218 -224272650 478333359 413389733 588834434 123402589 450461738 -907685390 592112697 510673053 -71658433 736629003 -318560996 -141290845 -444937898 -459572471 186057179 891066181 -616023586 566675270 33106159 218264314 -867446663 -725538434 801210456 401686978 787572866 -277779221 -973014955 -69868653 442050257 145783245 -807694889 -429854859 -176156385 892324340 152593604 -830958987 -226512739 754414923 605036178 -795183243 358431353 -82326553 -613301214 154830903 560331753 896590742 -330324463 630737949 -561388349 323148941 -910103568 -51137529 -938991535 324730443 -…
Output: 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 988491418 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 989566442 …

Example 3:

Input: 398 98 737855039 -868315835 -168611558 -82521343 120390686 282569488 -356675162 651400218 -909319991 243659162 -288622112 58603337 25190584 -569495829 -822640203 70777723 374436794 963508473 -926086960 -994659411 -427951021 660511636 713686828 638924424 964313902 -403573705 352091009 -673485260 -375321779 146584513 933441685 -955461178 780171563 -288716690 485674952 473534739 349475358 -732743923 -625746473 5607273 727131033 -154450401 969022575 -699282583 -761852089 -1623288 263989470 -791320865 574573870 -186390930 404900027 536240851 -804434691 -75156144 284242443 -481548414 407748430 -219025121 -535930063 264376315 -118610779 -200875622 -720637615 -339401536 24339258 -600187150 -107871902 -974572955 234592549 870328697 3700080 673661299 -979012377 -745659107 722839580 -993183690 -44349…
Output: 969022575 969022575 969022575 969022575 969022575 969022575 969022575 969022575 969022575 969022575 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 992347274 …

Constraints:

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

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