CT49917

The Ruby signals of Jace

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the wheat plains of Amberfield. Jace spreads the signals records across the table and picks up a sharp pencil. 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: 1794 -258013125 996670978 704844891 -660008609 232056429 -394380025 899341100 -856531315 -461765079 458640973 -274135678 803660884 -204599144 -856210340 529628119 936867707 -826648138 415098191 -762208423 -161681242 -755833593 -994322099 314032202 -520757882 495716656 419573426 -740669002 904638674 -643761870 739092648 -456129007 521907545 241699036 983948507 151387012 -843434412 -8149919 527453200 101727268 522927209 -166674054 -679774996 407713440 -376139433 822897497 746169703 62352590 350441481 -141343586 -496023975 758533554 635162993 -49763056 -723652712 -686559848 -887831914 653333790 -79554193 438877067 -112045697 -181779380 872364277 644294913 947981035 -635986391 4537659 223018362 -995983552 56703755 394687030 -699006372 -924679406 993222838 -860745672 -483334496 648053157 -27615…
Output: 996670978 996697482 899341100 232056429 899341100 899341100 936867707 -461765079 458640973 803660884 803660884 936867707 529628119 529628119 936867707 983948507 415098191 495716656 -161681242 314032202 314032202 314032202 495716656 495716656 904638674 904638674 904638674 983948507 739092648 983948507 521907545 983948507 983948507 993222838 527453200 -8149919 527453200 822897497 522927209 822897497 407713440 407713440 822897497 822897497 872364277 758533554 350441481 758533554 758533554 758533554 872364277 653333790 653333790 -686559848 653333790 653333790 872364277 438877067 872364277 872364277 872364277 947981035 947981035 993222838 4537659 223018362 394687030 56703755 394687030 993222838 993222838 993222838 994948766 -483334496 648053157 831339071 -247048154 831339071 925644910 925644910…

Example 2:

Input: 1120 763659167 -937850080 129250767 -578755118 -459811648 -317480129 -471107890 -271926290 313953471 748921397 -167355397 450558841 -809699101 635251358 -159949501 792775348 -940959862 -864031037 -971065536 -102143728 -396591674 -660730201 290345234 -448729132 528633180 740682587 95580419 -658858947 254517912 -574287275 768878415 10305288 93490041 -291709187 729147691 -945379052 115620218 -468605890 -936352026 351441706 -854129866 -726629365 477100350 -932345712 -676179668 166481247 -725761059 258027336 -129750008 212333106 -748217813 664101672 658135284 -65532103 -214271735 448940705 502313153 576683592 168993126 -876089815 -520471031 797912726 488921933 -700319817 1700414 806403183 417022868 381047857 574495192 -363107922 823909571 459412233 399726206 697833346 346930559 -993276133 -2087…
Output: 792775348 129250767 313953471 -459811648 -317480129 -271926290 -271926290 313953471 748921397 792775348 450558841 635251358 635251358 792775348 792775348 797912726 -864031037 -102143728 -102143728 290345234 290345234 290345234 528633180 528633180 740682587 768878415 254517912 254517912 768878415 768878415 797912726 93490041 729147691 729147691 797912726 115620218 351441706 351441706 351441706 477100350 -726629365 477100350 664101672 -676179668 166481247 258027336 258027336 664101672 212333106 664101672 664101672 797912726 797912726 448940705 448940705 502313153 576683592 797912726 797912726 -520471031 797912726 806403183 806403183 1700414 806403183 823909571 574495192 574495192 823909571 823909571 960565122 697833346 697833346 960565122 960565122 -208714553 65450578 -286533853 -286533853 6…

Example 3:

Input: 2893 476126988 -988951773 -484010811 -814018448 864398856 -454247393 -459040407 -561626792 998951157 38880924 261031719 -655020314 -484007986 625469509 421028656 381423273 -908643812 944083149 931693537 -287653343 -573596007 -931446204 -617659106 849941105 937539524 -475380458 561094954 -170910463 -854215207 259626276 81796598 980526073 -931562822 -235021819 -929410587 990218104 556650058 -335177374 796546750 -460002578 849600722 104877274 -217748978 -771871056 -754049032 634783878 344772823 -215895673 276449508 34091332 -175555635 -627277200 725100036 272724351 -480988813 736587404 150964398 719197560 81384531 -974603230 -12493353 748572258 7229086 23528729 908223157 -871459696 854426233 -869352958 410759772 -355054813 -94001117 -144957052 -112563629 785029891 -252750774 -864605288 828437…
Output: 864398856 -484010811 864398856 864398856 998951157 998951157 998951157 998951157 999296285 261031719 625469509 -484007986 625469509 944083149 944083149 944083149 944083149 980526073 937539524 849941105 849941105 -617659106 849941105 937539524 980526073 561094954 980526073 259626276 259626276 980526073 980526073 990218104 -235021819 990218104 990218104 999296285 796546750 796546750 849600722 849600722 908223157 634783878 634783878 -754049032 634783878 725100036 725100036 276449508 725100036 725100036 725100036 725100036 736587404 736587404 736587404 748572258 719197560 748572258 748572258 -12493353 748572258 908223157 23528729 908223157 958124560 854426233 958124560 410759772 785029891 -94001117 785029891 -112563629 785029891 828437837 828437837 828437837 832360085 671287279 671287279 71181…

Constraints:

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

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