CT52262

Secret registers Taller Ahead

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the crane marshes of Stillwater pays by the answer, and Chandler intends to earn it. First: the full register of registers. Task: For each element print the value of the nearest element to its right that is strictly greater, or -1. Input format: First line: n. Second line: n integers. Output format: Print n answers space-separated. Constraints: 1 <= n <= 4000; -10^9 <= a[i] <= 10^9.

Example 1:

Input: 226 426158769 -407702418 -830772686 507202876 -326225807 -278892116 -81738604 55323411 223149958 -126430863 609517728 -273526323 -989632986 760573672 213693600 -780774987 -248929851 204709375 -809511803 -224296141 -460680592 388234728 -532367557 951064344 300149928 14521731 258885710 -446585746 113401691 -415815940 -857527056 254703744 136637718 377718550 -490557930 -485059696 339916501 -538930534 -434241518 121953058 -907518588 -218491004 -845025834 -877819023 94954869 978774121 388507918 -955079241 -634204248 -609742826 -612420340 -813113806 101766609 -38965188 168096962 -6855832 206504653 -51255581 982864966 -724830213 -311227360 -250532441 243457874 911514260 409830454 528213429 -630083929 272433758 894274447 -840736975 -872226582 -356475038 -888204536 -486906636 693207752 190080248 15…
Output: 507202876 507202876 507202876 609517728 -278892116 -81738604 55323411 223149958 609517728 609517728 760573672 760573672 760573672 951064344 388234728 -248929851 204709375 388234728 -224296141 388234728 388234728 951064344 951064344 978774121 377718550 258885710 377718550 113401691 254703744 254703744 254703744 377718550 377718550 978774121 -485059696 339916501 978774121 -434241518 121953058 978774121 -218491004 94954869 94954869 94954869 978774121 982864966 982864966 -634204248 -609742826 101766609 101766609 101766609 168096962 168096962 206504653 206504653 982864966 982864966 985123572 -311227360 -250532441 243457874 911514260 985123572 528213429 894274447 272433758 894274447 985123572 -356475038 -356475038 693207752 -486906636 693207752 985123572 985123572 985123572 985123572 989411448 7…

Example 2:

Input: 1795 -857184136 -617995722 -593671015 -544098702 -732411419 978369211 -812286074 -937425826 157306944 724974180 -477715297 995389338 -127418389 621495583 672625215 685359549 278081071 -445383422 -909151613 66146972 -689998781 -644819613 -735232361 -564027891 -877380316 -133571095 385179078 296960269 -968211341 273515335 125945767 809997710 639381028 -441778270 -681995426 -604763086 115233006 -264817474 -389989333 806923575 71557317 650290131 -841093259 -397381731 -267968382 -786937314 410560543 -584183223 860290291 837663342 477330916 -730096197 -235479991 -958446977 862187632 -533170474 301364488 -454702542 367853803 -887459210 558810658 -927825198 839631506 -92537927 563242650 -590925219 -554939168 -23719486 634018531 859170893 41360703 -311359253 -75049014 -104241863 -34933471 556047804…
Output: -617995722 -593671015 -544098702 978369211 978369211 995389338 157306944 157306944 724974180 995389338 995389338 997887235 621495583 672625215 685359549 809997710 385179078 66146972 66146972 385179078 -644819613 -564027891 -564027891 -133571095 -133571095 385179078 809997710 809997710 273515335 809997710 809997710 860290291 806923575 115233006 -604763086 115233006 806923575 806923575 806923575 860290291 650290131 860290291 -397381731 -267968382 410560543 410560543 860290291 860290291 862187632 862187632 862187632 -235479991 862187632 862187632 958132455 301364488 367853803 367853803 558810658 558810658 839631506 839631506 859170893 563242650 634018531 -554939168 -23719486 634018531 859170893 958132455 556047804 -75049014 -34933471 -34933471 556047804 958132455 958132455 997887235 436953566…

Example 3:

Input: 1359 -844624605 -959421422 -139547521 -332272520 344215179 946760277 -962514188 762010178 -207317031 961088588 -306061437 615073501 97988454 -188130815 847177451 271028014 -89879146 709089270 -289471207 -227228632 -168467728 -957954366 332457503 -358902161 -894865674 270975797 240408900 -393626621 332867995 -536056212 871180142 548552869 -529186873 -777183880 258221326 -804393818 -568183690 -723109357 936671579 514492737 886886335 -276691265 237191506 581006145 238304992 449729493 -429745422 -287568640 -766059799 -781326118 848498354 -666686506 59811449 203134912 -776772424 830060481 755070860 -130312195 57188279 -699068930 -501599443 797764749 -730266726 421095148 45288429 -617786497 430104737 305917599 -8812518 382443569 60080420 162679186 201038742 741315399 235413011 713775344 53495272…
Output: -139547521 -139547521 344215179 344215179 946760277 961088588 762010178 961088588 961088588 981264609 615073501 847177451 847177451 847177451 871180142 709089270 709089270 871180142 -227228632 -168467728 332457503 332457503 332867995 270975797 270975797 332867995 332867995 332867995 871180142 871180142 936671579 936671579 258221326 258221326 936671579 -568183690 936671579 936671579 959598614 886886335 959598614 237191506 581006145 848498354 449729493 848498354 -287568640 848498354 848498354 848498354 959598614 59811449 203134912 830060481 830060481 959598614 797764749 57188279 797764749 -501599443 797764749 959598614 421095148 430104737 430104737 430104737 741315399 382443569 382443569 741315399 162679186 201038742 741315399 959598614 713775344 959598614 959598614 959598614 981264609 11067…

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Secret registers Taller Ahead - MEDIUM Coding Problem | CodeTikki