CT39434

Tara's registers Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The valuer Tara has been asked to publish the quarterly findings. On the desk lies a long table of registers readings. 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: 3141 951591705 666728470 968856792 -954197257 -728513222 700950877 -1575227 523963029 54560493 -624450161 468627355 86328534 -20690750 -395940385 -398213923 -749369608 417016893 -283367054 205626570 -223921280 108038676 -263070038 154185391 498179547 47305988 -76796289 624734232 -906018140 556315295 -318428150 -589233763 -900662599 -117447314 622896332 162564213 970641697 561393438 -193226205 383295032 -518837636 698331695 183110992 -188857941 -280399475 -499715679 585382448 -263758629 -379614970 -515477923 -428541123 -207560119 180597726 -152953345 971897571 -640371443 70285919 24250712 759075192 562137283 994323736 61105702 -610681281 -713445055 -273705000 690586321 -743391625 -551440261 -714926186 -720446694 -814076244 -643630218 -863892652 -903390975 353862002 539039294 59156421 -49844…
Output: 968856792 968856792 970641697 -728513222 700950877 970641697 523963029 624734232 468627355 468627355 498179547 417016893 417016893 417016893 417016893 417016893 498179547 205626570 498179547 108038676 154185391 154185391 498179547 624734232 624734232 624734232 970641697 556315295 622896332 -117447314 -117447314 -117447314 622896332 970641697 970641697 971897571 698331695 383295032 698331695 698331695 971897571 585382448 585382448 585382448 585382448 971897571 -207560119 -207560119 -428541123 -207560119 180597726 971897571 971897571 994323736 70285919 759075192 759075192 994323736 994323736 994534276 690586321 -273705000 -273705000 690586321 756871892 -551440261 353862002 -643630218 -643630218 -643630218 353862002 353862002 353862002 539039294 652049069 74439417 -389239700 74439417 32621630…

Example 2:

Input: 3937 687642090 365088653 245517587 -693942305 -623754132 -865670061 -172285096 620962185 -886491598 -198469943 -141936035 882483799 495327051 -367592870 927494416 722163297 299994766 -905455401 -751054249 -666438504 -252866428 -574749038 619814404 810524256 -284204733 -208212122 635320793 -712090794 285241614 -560371719 -893454742 -8317660 -759386441 754943068 791052028 -660636701 586195815 -980167261 420062340 -228150893 -989078621 -54564842 888023078 583750700 -284305825 780903406 -609429014 -646673134 -107867177 -17169198 167866049 -47499709 964900144 669180829 251829265 683533773 784284649 -623590961 -409277280 -879331460 -952552869 61684916 414385818 916315220 736699101 -330935877 632608857 -389874244 139703878 989950240 472075647 -459283088 -950700816 654278153 -66659880 219981710 60…
Output: 882483799 620962185 620962185 -623754132 -172285096 -172285096 620962185 882483799 -198469943 -141936035 882483799 927494416 927494416 927494416 964900144 810524256 619814404 -751054249 -666438504 -252866428 619814404 619814404 810524256 888023078 -208212122 635320793 754943068 285241614 754943068 -8317660 -8317660 754943068 754943068 791052028 888023078 586195815 888023078 420062340 888023078 -54564842 -54564842 888023078 964900144 780903406 780903406 964900144 -107867177 -107867177 -17169198 167866049 964900144 964900144 989950240 683533773 683533773 784284649 916315220 -409277280 61684916 61684916 61684916 414385818 916315220 989950240 989950240 632608857 989950240 139703878 989950240 996072792 654278153 654278153 654278153 966472658 219981710 608308844 966472658 982963557 903861576 745…

Example 3:

Input: 394 164311052 -69534977 -379385328 124778109 845908278 683407645 -929997938 787081750 -540018751 -392636890 -294024031 -53060654 -299844453 59834218 -687233863 -794957219 -79679738 548951563 101703041 118089873 -549129136 -722346428 -464951083 14626653 30388339 288563721 232252243 -652539127 -395501251 687522513 -189856136 517367090 -408037667 -741370053 315105193 -244723558 -466945937 -377701537 858103773 -913520391 940065791 -452036107 226763575 -378210440 57770650 -33525080 837807344 618174659 297491973 -490183842 513599437 545927577 828162436 480204800 227840556 452824299 986548199 911825154 922167440 429988773 351267749 -598788334 -523963886 -401304958 274119530 320720407 230919878 308301593 -92834846 -77010368 77356840 551603363 -453512718 -506230933 958793005 -159299185 -165284030 5…
Output: 845908278 124778109 124778109 845908278 858103773 787081750 787081750 858103773 -392636890 -294024031 -53060654 59834218 59834218 548951563 -79679738 -79679738 548951563 687522513 118089873 288563721 -464951083 -464951083 14626653 30388339 288563721 687522513 687522513 -395501251 687522513 858103773 517367090 858103773 315105193 315105193 858103773 858103773 -377701537 858103773 940065791 940065791 986548199 226763575 837807344 57770650 837807344 837807344 986548199 828162436 513599437 513599437 545927577 828162436 986548199 986548199 452824299 986548199 990442826 922167440 958793005 551603363 551603363 -523963886 -401304958 274119530 320720407 551603363 308301593 551603363 -77010368 77356840 551603363 958793005 958793005 958793005 986345021 54339179 54339179 843438342 -291569430 -29156943…

Constraints:

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

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