CT44290

The Amber beacons of Lara

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

In the lily shoals of Padmore, Lara the registry keeper keeps careful count of the beacons. win the guild's seasonal contest, every figure matters. 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: 3096 -427144662 3867641 119594765 165973670 237504395 348337949 -200875509 528858965 -254612102 330837689 -699457814 664432772 -896834272 -366061993 -315659111 817377784 37056923 -858474260 -459206628 -505109829 768430019 145815246 -316615014 -157480795 175739145 -306011270 502130008 94131664 176635344 765140091 -656142792 -63754687 408862122 555726299 -728341421 -95376640 168418042 610993847 31071622 318835565 68873116 -702122973 -117207589 -135491431 161160288 980716663 42426728 938152471 -533298337 -501800153 -32086643 478460894 -26148402 277920227 -827316793 507444314 -643225549 350764448 -605671552 75709019 860293108 812858625 968233945 285106907 738033381 463787052 224381752 481158313 -776407198 -881788429 541352985 377154222 -76590411 -257661781 735869254 -306673184 -856597533 45397…
Output: 3867641 119594765 165973670 237504395 348337949 528858965 528858965 664432772 330837689 664432772 664432772 817377784 -366061993 -315659111 817377784 980716663 768430019 -459206628 768430019 768430019 980716663 175739145 -157480795 175739145 502130008 502130008 765140091 176635344 765140091 980716663 -63754687 408862122 555726299 610993847 -95376640 168418042 610993847 980716663 318835565 980716663 161160288 -117207589 161160288 161160288 980716663 995629307 938152471 968233945 -501800153 -32086643 478460894 507444314 277920227 507444314 507444314 860293108 350764448 860293108 75709019 860293108 968233945 968233945 995629307 738033381 854951217 481158313 481158313 541352985 541352985 541352985 735869254 735869254 735869254 735869254 854951217 453970135 453970135 854951217 368970566 8549512…

Example 2:

Input: 2623 -650850950 682608562 -501696274 365112834 527318359 -394125998 -176464168 -981165095 770579100 476645984 -103257543 -191342327 -592485393 317312476 -469833102 764423530 88465053 -99555949 598651752 567167268 -467448588 -54851683 962676809 -621378871 -737893363 -127676887 141500764 -214042342 417664168 831246830 -996168502 -679699452 576083712 958164205 132540433 -410208431 33638184 566762952 -905458815 470978460 -79349703 -130637684 26077220 8631131 -821581740 546107887 -71698143 243733721 -400218569 -319014616 649091210 -635992442 223221798 18580383 -993934754 -639554691 981717472 -22662709 -605050529 578077805 481747123 559839816 158336336 -58807499 -816396827 155372976 -580101657 -127452125 613135565 -1574899 -510360154 193198496 566146114 367356576 694149580 -867590435 757535956 -…
Output: 682608562 770579100 365112834 527318359 770579100 -176464168 770579100 770579100 962676809 764423530 317312476 317312476 317312476 764423530 764423530 962676809 598651752 598651752 962676809 962676809 -54851683 962676809 981717472 -127676887 -127676887 141500764 417664168 417664168 831246830 958164205 -679699452 576083712 958164205 981717472 566762952 33638184 566762952 649091210 470978460 546107887 26077220 26077220 546107887 546107887 546107887 649091210 243733721 649091210 -319014616 649091210 981717472 223221798 981717472 981717472 -639554691 981717472 998326857 578077805 578077805 613135565 559839816 613135565 613135565 155372976 155372976 613135565 -127452125 613135565 694149580 193198496 193198496 566146114 694149580 694149580 757535956 757535956 819333038 -145822985 -145822985 8193…

Example 3:

Input: 3352 -406249660 -551233301 14468020 -759199973 54097801 -954263178 -333450346 -634304306 -787595862 -503325203 922380939 866090021 268531073 -104255025 938565202 -579139850 400285471 -910931952 -734713158 186205624 66788236 493313927 -933390334 946868622 634044376 473784165 -523290014 -468382295 901022689 -667780848 432780205 -605676806 977458417 -400343416 -110500566 -368379490 -222090989 -821285691 -31542610 333506578 -830711411 -406898734 860920378 637592642 -3533219 -364734317 -713915145 113579438 403386709 628993925 -877357029 464922483 -51763096 -84570668 -455566017 -858100095 69716153 804218742 606459087 646922604 420792747 915214477 274419875 753613348 704321555 396103314 -709707391 607118280 161648391 78241086 904810797 -273251024 -685918713 278127660 -690985276 523053645 -3989590…
Output: 14468020 14468020 54097801 54097801 922380939 -333450346 922380939 -503325203 -503325203 922380939 938565202 938565202 938565202 938565202 946868622 400285471 493313927 -734713158 186205624 493313927 493313927 946868622 946868622 977458417 901022689 901022689 -468382295 901022689 977458417 432780205 977458417 977458417 993588041 -110500566 -31542610 -222090989 -31542610 -31542610 333506578 860920378 -406898734 860920378 915214477 804218742 113579438 113579438 113579438 403386709 628993925 804218742 464922483 804218742 69716153 69716153 69716153 69716153 804218742 915214477 646922604 915214477 915214477 922777199 753613348 904810797 904810797 607118280 607118280 904810797 904810797 904810797 922777199 278127660 278127660 523053645 523053645 724738491 271640493 724738491 886159127 683203635 …

Constraints:

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

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