CT49802

Wynne Counts the registers

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Morning light hits the island market of Coralcove as Wynne unrolls the day's manifest of registers. The tally will decide the next shipment. 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: 2299 -905979583 524952203 202278085 489449943 -358069820 559971300 -653137822 870297100 -753347751 187357388 246213967 -310710644 961014201 -791421870 547362855 -178430396 139593017 -269060717 -504773669 171806772 -955241280 -900632552 -954253457 -715619139 -381570510 362590951 61727952 -579653842 320295905 -858686095 -545559976 -881346829 -205463937 -647736519 633256811 -842903572 -952550089 674407594 708660212 682590055 531915097 892168697 449240298 331958672 -321982684 -795645314 451643514 -338855387 944985683 -219574765 230349128 588422314 -89860584 936285323 296348301 880497716 -563121354 911737149 191058659 626464514 -429449946 -51830447 -942610918 -16201906 568734763 502212347 -871955610 -280423499 -363288142 -781565699 -481915203 -236239103 897102462 -964705878 -152047344 365153853…
Output: 524952203 559971300 489449943 559971300 559971300 870297100 870297100 961014201 187357388 246213967 961014201 961014201 964077128 547362855 633256811 139593017 171806772 171806772 171806772 362590951 -900632552 -715619139 -715619139 -381570510 362590951 633256811 320295905 320295905 633256811 -545559976 -205463937 -205463937 633256811 633256811 674407594 674407594 674407594 708660212 892168697 892168697 892168697 944985683 451643514 451643514 451643514 451643514 944985683 944985683 964077128 230349128 588422314 936285323 936285323 964077128 880497716 911737149 911737149 964077128 626464514 897102462 -51830447 -16201906 -16201906 568734763 897102462 897102462 -280423499 -236239103 -236239103 -481915203 -236239103 897102462 964077128 -152047344 365153853 768865316 28626429 -468449134 2862642…

Example 2:

Input: 2107 857856649 -76409781 -245375486 -600609483 -148481430 540712432 -453170454 656969401 -208446932 -57349125 310754368 152457398 -712830980 -493221667 980347650 -705433367 -678616371 -543579022 -225378074 -660656155 547647834 -417169604 -464046181 -751317658 -680470609 918763157 836598245 -703042514 79508594 -371174795 39644313 992696689 587228287 799227573 -417794904 -709210511 368767998 -303807119 700735160 -932080010 808962436 -431115314 -530284544 335183399 -780507795 -863209599 343011446 -27558777 -979687455 894274358 -879218946 403584867 -310123126 281311492 -851418724 -484676889 982700944 -911064052 -735983299 587555671 -244884622 -604970930 -585217353 -466739155 -880486267 939468450 -636046476 831080103 832774716 468334579 62652519 -743886197 299521158 490267171 520125450 31902566…
Output: 980347650 540712432 -148481430 -148481430 540712432 656969401 656969401 980347650 -57349125 310754368 980347650 980347650 -493221667 980347650 992696689 -678616371 -543579022 -225378074 547647834 547647834 918763157 918763157 918763157 -680470609 918763157 992696689 992696689 79508594 992696689 39644313 992696689 994185423 799227573 808962436 368767998 368767998 700735160 700735160 808962436 808962436 894274358 335183399 335183399 343011446 343011446 343011446 894274358 894274358 894274358 982700944 403584867 982700944 281311492 982700944 -484676889 982700944 994185423 -735983299 587555671 939468450 939468450 -585217353 -466739155 939468450 939468450 982243849 831080103 832774716 889393260 490267171 299521158 299521158 490267171 520125450 889393260 339968489 339968489 339968489 516319577 8…

Example 3:

Input: 3282 951486741 270643292 -922007480 -732254161 713036553 858423877 725579530 -986246205 597224131 607001933 -331327639 -883883570 130781342 199987371 283873544 -213730671 158980596 -907922721 430327315 151953860 -547629915 942010279 -852993170 -989702930 -632939400 819616248 839444962 -385701462 47928165 564474464 147608391 -663476456 29176570 147988021 -489529370 -228771710 -779654025 753755077 274429839 468729740 -482295497 803055561 408835851 -439733463 457908791 -100023405 553771506 657064048 872799914 947210048 695766375 -953373674 919919717 10184147 563922841 259078318 372967072 -938001263 -357976555 383449404 -862882176 83454108 -703215439 -190405027 -502710946 755010737 -708534633 -936633721 -632598276 -350404393 329042114 -191989379 -777803821 363554719 151072181 -830711693 -22812…
Output: 981016702 713036553 -732254161 713036553 858423877 942010279 942010279 597224131 607001933 942010279 130781342 130781342 199987371 283873544 430327315 158980596 430327315 430327315 942010279 942010279 942010279 947210048 -632939400 -632939400 819616248 839444962 872799914 47928165 564474464 753755077 147988021 29176570 147988021 753755077 -228771710 753755077 753755077 803055561 468729740 803055561 803055561 872799914 457908791 457908791 553771506 553771506 657064048 872799914 947210048 981016702 919919717 919919717 981016702 563922841 755010737 372967072 383449404 -357976555 383449404 755010737 83454108 755010737 -190405027 755010737 755010737 839636489 -632598276 -632598276 -350404393 329042114 363554719 363554719 363554719 839636489 181774680 -228122242 181774680 -676231936 181774680 83…

Constraints:

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

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