CT44620

Opal's Taller Ahead Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

In the canyon post of Redrock, Opal the ledger master keeps careful count of the signals. Prepare the guildmaster's brief, 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: 480 -109654449 984100979 252529140 364471357 266463405 -411368224 342840927 -182411122 163187822 939318558 -299820121 107672760 -910551061 -849013368 -363799364 -72628376 798285939 -964449811 -315744502 -10510546 -550865630 397985860 665974589 680375194 475865795 -956342924 -229586780 -970649772 -189198813 -675718844 -509661442 713024211 625604334 604400861 -955649062 316787572 -877690212 995579472 -68675870 -829142712 951099727 -615691557 876894255 -420856707 595965341 -715835082 574538877 153348395 -663906951 654518882 -807625094 -2747793 331412797 36291674 688313803 -279224487 -184031298 553604024 -674278799 -614177320 254193329 -690306799 624270217 -920519673 -936046068 -630069671 209347558 -837359738 -568887087 -17320457 678518321 -84856288 446566157 -143539154 -550094363 696918618 -9…
Output: 984100979 995579472 364471357 939318558 342840927 342840927 939318558 163187822 939318558 995579472 107672760 798285939 -849013368 -363799364 -72628376 798285939 995579472 -315744502 -10510546 397985860 397985860 665974589 680375194 713024211 713024211 -229586780 -189198813 -189198813 713024211 -509661442 713024211 995579472 995579472 995579472 316787572 995579472 995579472 999554644 951099727 951099727 980278977 876894255 891566233 595965341 654518882 574538877 654518882 654518882 654518882 688313803 -2747793 331412797 688313803 688313803 696918618 -184031298 553604024 624270217 -614177320 254193329 624270217 624270217 678518321 -630069671 -630069671 209347558 678518321 -568887087 -17320457 678518321 696918618 446566157 696918618 696918618 696918618 846033186 -676611442 571972701 57197270…

Example 2:

Input: 1184 -794431174 490305444 294964328 649412475 624368037 -279012220 353829390 102675251 -657439512 -574068604 -548773633 -877393875 -569615972 -908216780 531702227 580385768 -198566323 895213904 -748030907 -882375784 357366414 659999322 -732581540 -253963878 943282274 -718637556 402393196 782351841 -501449289 -530983953 596200494 287768271 -648959600 567656755 -319979407 99702886 -525065955 -515742864 129771005 -26117031 363301237 489221700 501714251 757306185 -719300888 -264844318 438716622 390894918 338917765 -52692138 -205928560 -682672264 267334735 -468877783 406965369 -216621299 158988664 -741158629 933866639 -294537618 -253065599 -747786145 -648069295 881784520 -59350548 385451611 794148337 860731131 359329533 787186595 404848147 206665813 131199534 -232883288 -70903524 -914947037 -87…
Output: 490305444 649412475 649412475 895213904 895213904 353829390 531702227 531702227 -574068604 -548773633 531702227 -569615972 531702227 531702227 580385768 895213904 895213904 943282274 357366414 357366414 659999322 943282274 -253963878 943282274 974052777 402393196 782351841 933866639 596200494 596200494 757306185 567656755 567656755 757306185 99702886 129771005 -515742864 129771005 363301237 363301237 489221700 501714251 757306185 933866639 -264844318 438716622 933866639 406965369 406965369 267334735 267334735 267334735 406965369 406965369 933866639 158988664 933866639 933866639 974052777 -253065599 881784520 -648069295 881784520 909929064 385451611 794148337 860731131 909929064 787186595 909929064 445832492 445832492 445832492 -70903524 445832492 -871081000 -368164839 445832492 909929064 9…

Example 3:

Input: 3325 376294700 -796657710 263576743 -829915377 22658667 362223366 -860630370 -187047860 341425891 -293005616 473150271 -906103071 -187340385 676912753 -151942267 720853424 177121878 746088945 749234520 -207984748 -638224718 -193597066 946130506 -543031344 328508870 -32134283 -828708827 -335254193 -434584327 -434743816 -175173299 768769172 -174704138 -134331693 -166139740 -923715883 -550560582 -185768133 -599385004 848006599 -212063559 -918626468 562181863 638108778 360826083 -390800478 -146752776 -129784478 284931087 171240285 -347235173 -340148027 -499199584 -791935835 -226560543 432774267 -592981467 -601076092 760431207 875926871 -860130811 736084234 -34332334 208823647 -363252179 -31871041 -454543243 515847173 177205335 757263126 984287278 569195836 163110696 895578720 -621562443 654158…
Output: 473150271 263576743 362223366 22658667 362223366 473150271 -187047860 341425891 473150271 473150271 676912753 -187340385 676912753 720853424 720853424 746088945 746088945 749234520 946130506 -193597066 -193597066 946130506 984287278 328508870 768769172 768769172 -335254193 -175173299 -175173299 -175173299 768769172 848006599 -134331693 848006599 848006599 -550560582 -185768133 848006599 848006599 875926871 562181863 562181863 638108778 760431207 432774267 -146752776 -129784478 284931087 432774267 432774267 -340148027 -226560543 -226560543 -226560543 432774267 760431207 760431207 760431207 875926871 984287278 736084234 757263126 208823647 515847173 -31871041 515847173 515847173 757263126 757263126 984287278 989639043 895578720 895578720 947201168 654158417 947201168 947201168 947201168 9472…

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Opal's Taller Ahead Ledger - MEDIUM Coding Problem | CodeTikki