CT46859

Curator's registers Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the sulphur springs of Brimstone close for winter, Curator must finish the registers ledger - one figure at a time. 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: 708 -363291331 936174340 332915050 949787315 -739728037 549055945 296303268 -919164439 912055814 58806094 512449834 -723570117 489201574 512422809 -281110519 48944465 449264480 -614740138 -943815946 979077022 -487348971 81227381 -238911930 467617007 59215838 -840515948 -136481499 804106621 324532882 -490067115 -472892299 -417670013 -739796861 876038365 185192019 82261621 763646822 263797820 -380435822 -500847754 -152703794 329837500 -283496277 -630947248 -924018807 675787104 -41645234 -837396255 403673543 375105693 568820157 671048561 -285646316 438578233 868021811 -441666432 -490158571 274833037 -910434823 -158017297 -88824118 -604748496 524302200 -476625646 721370402 543779742 669423531 680150882 -48740335 -983274577 -296110708 -802509294 -585060779 -364138833 938991413 -600122666 -30889…
Output: 936174340 949787315 949787315 979077022 549055945 912055814 912055814 912055814 979077022 512449834 979077022 489201574 512422809 979077022 48944465 449264480 979077022 979077022 979077022 996662909 81227381 467617007 467617007 804106621 804106621 -136481499 804106621 876038365 876038365 -472892299 -417670013 876038365 876038365 938991413 763646822 763646822 868021811 329837500 -152703794 -152703794 329837500 675787104 675787104 675787104 675787104 868021811 403673543 403673543 568820157 568820157 671048561 868021811 438578233 868021811 938991413 274833037 274833037 524302200 -158017297 -88824118 524302200 524302200 721370402 721370402 938991413 669423531 680150882 938991413 938991413 -296110708 938991413 -585060779 -364138833 938991413 969766118 -308896572 741031435 875227972 969766118 99…

Example 2:

Input: 2126 194760363 -65952605 -394445171 204867797 85827607 -709452429 -911098547 701885063 -762729052 998215319 -613919782 -581382448 -532079142 -471793191 -62138150 -335121039 591237577 275409341 -499342630 852738087 166367406 -148241395 77325899 -732514531 659830384 -316248789 814619692 -822405941 84626667 115987452 689373893 512511201 -922402306 -37662877 632799407 618558962 -517542898 380160064 -850254040 -690975241 162266589 537910274 619108045 551936070 -286886089 497150064 -419447539 778033724 547022151 -850986337 -412655765 -360907574 -523090653 674180776 637057215 295493940 -993994868 -630221810 28658401 -691175590 333664359 -573175317 -294517996 158047394 -652567890 611035526 -189444317 431538915 -415599345 896074410 -561307432 642315979 -608478734 161776491 242215523 -713321073 -687…
Output: 204867797 204867797 204867797 701885063 701885063 701885063 701885063 998215319 998215319 998297032 -581382448 -532079142 -471793191 -62138150 591237577 591237577 852738087 852738087 852738087 896074410 659830384 77325899 659830384 659830384 814619692 814619692 896074410 84626667 115987452 689373893 778033724 632799407 -37662877 632799407 778033724 619108045 380160064 537910274 -690975241 162266589 537910274 619108045 778033724 778033724 497150064 778033724 778033724 896074410 674180776 -412655765 -360907574 674180776 674180776 896074410 896074410 333664359 -630221810 28658401 333664359 333664359 611035526 -294517996 158047394 611035526 611035526 896074410 431538915 896074410 896074410 927880571 642315979 861260204 161776491 242215523 263811877 -68787716 263811877 598068688 861260204 86126…

Example 3:

Input: 3511 -909104168 -70238933 893804017 -982103278 -843043453 388627899 687285601 234965542 566072654 227764897 311915991 -726561936 621849922 -225859748 464456192 -229223422 -101742094 495965003 -295276188 -778499164 -757799897 -646365611 16923258 843778580 378194081 959580950 -703787909 198459822 -76049557 475695936 -41897483 -726705160 215061597 829815261 -912774707 -90295378 921303811 -145510692 -469974700 55911606 893579889 352591091 -182184110 55209141 -74638295 527250262 -157482993 -622426718 279378975 598059285 -288224354 -821150165 -384428395 -261309140 348751624 -245091594 290414765 -912161364 -199970111 201396953 146594343 -683976959 -337955891 -78182427 -654431725 577533792 -758825816 -687087793 -722311331 -671395112 -864411891 -609753963 683365097 296429363 -729628754 263020527 22…
Output: -70238933 893804017 959580950 -843043453 388627899 687285601 843778580 566072654 621849922 311915991 621849922 621849922 843778580 464456192 495965003 -101742094 495965003 843778580 16923258 -757799897 -646365611 16923258 843778580 959580950 959580950 983125850 198459822 475695936 475695936 829815261 215061597 215061597 829815261 921303811 -90295378 921303811 983125850 55911606 55911606 893579889 983125850 527250262 55209141 527250262 527250262 598059285 279378975 279378975 598059285 683365097 -261309140 -384428395 -261309140 348751624 577533792 290414765 577533792 -199970111 201396953 577533792 577533792 -337955891 -78182427 577533792 577533792 683365097 -687087793 -671395112 -671395112 -609753963 -609753963 683365097 983125850 983125850 263020527 983125850 983125850 983125850 983125850 9…

Constraints:

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

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