CT42264

Archivist's Taller Ahead Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

In the snowberry thicket of Winterholt, Archivist the auditor keeps careful count of the marks. Inspect the delivered goods, 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: 155 456412038 439998504 -37163811 878692293 -584605879 -838628650 629002216 -953930290 836992566 234813930 -650973374 -452752095 -303775451 990823977 400408026 280017532 -348140110 802030809 72515615 -500783105 -475001516 -192270580 -657376040 548531851 392800772 -372566503 537328575 466424918 -792724180 715101007 -915551865 255003718 139281632 856072305 -139305513 637444361 900204499 -91337924 873026885 345460939 -170038667 859775875 -586495075 -155910171 442251876 -553332405 595143358 -166050500 -23145177 -710735421 34732232 186122546 481793150 621189992 368394835 16253846 663419489 789149309 -266352705 -52846650 164256396 -14145849 -919079204 441471050 801949229 231796868 820772231 -324888595 -30925813 547076411 -465791656 642532378 236388830 -507324995 -626128626 984882502 -95736955 -6…
Output: 878692293 878692293 878692293 990823977 629002216 629002216 836992566 836992566 990823977 990823977 -452752095 -303775451 990823977 -1 802030809 802030809 802030809 856072305 548531851 -475001516 -192270580 548531851 548531851 715101007 537328575 537328575 715101007 715101007 715101007 856072305 255003718 856072305 856072305 900204499 637444361 900204499 984882502 873026885 984882502 859775875 859775875 984882502 -155910171 442251876 595143358 595143358 621189992 -23145177 34732232 34732232 186122546 481793150 621189992 663419489 663419489 663419489 789149309 801949229 -52846650 164256396 441471050 441471050 441471050 801949229 820772231 820772231 984882502 -30925813 547076411 642532378 642532378 984882502 984882502 984882502 984882502 988686325 513476645 513476645 789712785 807960363 3155…

Example 2:

Input: 2710 -137952583 899198669 -826645065 -146195405 604983884 -210203290 -145340996 408598993 117741605 967510870 753002171 568043673 -295635866 -796503482 -403407421 -74495218 739068756 932005586 -551139378 108431259 651832075 697113667 -82782414 -879910340 -634957417 72983468 18343439 459497574 -524282068 872932144 45641426 -660293699 299109733 -715257315 690862958 -869208335 -560710089 -153593350 443340297 -441185540 -633661641 -905415180 -352363115 94754876 -313950604 -859116268 105075058 -730798407 638517772 -369975486 -163815473 -633904617 -333183678 -595431796 551304865 -476498770 50648191 -843344096 -634908273 -327284172 -419105941 694792803 498792677 924159058 -423970140 193816080 -441154411 924275629 303514808 768396759 656963040 -226721378 884689756 832791384 216480432 -830764736 -9…
Output: 899198669 967510870 -146195405 604983884 967510870 -145340996 408598993 967510870 967510870 993457047 932005586 739068756 -74495218 -403407421 -74495218 739068756 932005586 993457047 108431259 651832075 697113667 872932144 72983468 -634957417 72983468 459497574 459497574 872932144 872932144 924159058 299109733 299109733 690862958 690862958 694792803 -560710089 -153593350 443340297 638517772 -352363115 -352363115 -352363115 94754876 105075058 105075058 105075058 638517772 638517772 694792803 -163815473 551304865 -333183678 551304865 551304865 694792803 50648191 694792803 -634908273 -327284172 694792803 694792803 924159058 924159058 924275629 193816080 924275629 924275629 993457047 768396759 884689756 884689756 884689756 993457047 993457047 721785890 -617179076 -617179076 721785890 827409344…

Example 3:

Input: 3076 -707175226 -636038241 947772186 526529083 953091837 -697400506 -324986473 -670523423 943422713 -585790920 -898257621 -787414142 542082030 -727537445 -36925979 -719995745 -772504236 -27716527 131663254 244831588 -32793402 304992709 -345239141 -765656420 120529613 -471324595 -905374438 -813890118 -835682604 293310737 -521076561 525671841 -826428179 -257434256 -999402791 -348544129 -456076559 518856183 -947541393 460447826 831398273 -88229042 746452341 -566944365 11211050 -738632634 -509696110 167294577 -658373813 682161391 -274957166 -180974115 -741859691 381894383 -324067853 820275438 -448366774 674045951 -736517347 218346367 -414667078 -105470342 164266465 659496624 42221424 404897191 357683466 277819855 -526279404 -564047390 612869498 -315818089 235698590 -875344313 -740208510 -12533…
Output: -636038241 947772186 953091837 953091837 997354289 -324986473 943422713 943422713 997354289 542082030 -787414142 542082030 831398273 -36925979 -27716527 -27716527 -27716527 131663254 244831588 304992709 304992709 525671841 120529613 120529613 293310737 293310737 -813890118 293310737 293310737 525671841 525671841 831398273 -257434256 518856183 -348544129 518856183 518856183 831398273 460447826 831398273 891269803 746452341 820275438 11211050 167294577 -509696110 167294577 682161391 682161391 820275438 -180974115 381894383 381894383 820275438 820275438 891269803 674045951 891269803 218346367 659496624 -105470342 164266465 659496624 891269803 404897191 612869498 612869498 612869498 612869498 612869498 891269803 235698590 303366113 -740208510 -125332602 303366113 303366113 891269803 891269803 …

Constraints:

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

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