CT42289

Uday Counts the signals

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the poppy fields of Scarlet Plain pays by the answer, and Uday intends to earn it. First: the full register of signals. 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: 1926 1019 -31025162 947637143 -871289282 40324134 -67408547 638570254 -890846511 114933453 -483595583 169124646 524100398 -386832833 -777868349 -234914370 -823768086 548992959 325628435 143834594 618717520 469112259 -439417368 528375613 930147460 -870084375 -911721022 -726428174 -197179439 -391480120 -699322191 -402863218 319991726 -625499846 177976235 670969551 590206815 251314197 -727221460 435464818 852887282 208012611 763886084 -293534430 -687459312 776285253 -896828826 -64712776 746935236 -463745840 163643590 306244719 -539572192 -159885935 994883907 743304942 -578709399 -69182478 -731753909 397360709 711274593 455261443 -539062809 -727510355 839558812 -101907625 832182048 170236683 159597525 508809198 444772924 453890875 525010176 466880834 323296792 18491405 -859644041 971836092 -88…
Output: 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 999336639 …

Example 2:

Input: 961 647 703528845 476354707 38136390 -50004353 710304918 -688963329 725081969 160795622 -146716675 -391435483 914742111 346318048 161623349 -327722211 610031400 598205534 -344758209 -537035756 278516796 -721968337 236370880 690830921 -67497739 -148446577 -972821951 145960554 579700015 772788168 -594866206 311201226 -299193629 921983684 813914531 330060669 580981250 262138678 -993393384 388989691 132343351 726766686 -964395428 -302209643 967446148 633396000 -676594687 388978853 471920522 460739938 -997113949 -548188072 -179761655 493777669 -380184413 265333354 -454962080 -898963944 -133526564 -24822067 -456824442 707329699 -872544192 637982561 291496618 -37799643 -61446274 -826060643 -147900570 630003117 -157279774 274007307 99726959 -830469965 -638487866 -167763006 471923294 -417582257 -72…
Output: 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 999804456 …

Example 3:

Input: 1758 858 452295461 -555343162 600036901 42350891 302938996 505777122 -455890353 734243729 325523757 382510680 -454483337 -490631269 924512166 -908551806 -56590482 519971184 193146930 46837799 116666264 -352085178 -370497086 287844154 473758936 -340203235 -428872710 933246578 903874692 489066020 188253745 -210151368 644637111 561808544 844704807 340053345 361768185 -897237528 -791564543 -361186230 2218789 133938871 -151871265 -450131905 -78990883 -853673550 741886832 627606821 602731343 -85803340 -668438918 -958352447 776430706 88404844 564601129 -627402348 150640117 176318332 15690678 561373098 -135744006 684964303 724580994 243573259 -31867622 -848364571 4668386 -693741461 -990580959 -254482193 -878449295 -243190967 271918578 -670570655 631820798 -482318544 826676377 -504417091 -285393745…
Output: 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 991702501 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 995362164 …

Constraints:

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

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