CT50768

Tomas's marks Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the jade shrine of Serpentis pays by the answer, and Tomas intends to earn it. First: the full register of marks. 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: 162 397855088 -773983880 -364116999 -495068578 909068691 644763505 -874586824 -722302455 972052436 -254833595 23976211 520708313 -661369075 -398948747 -285458783 309349374 -880235855 -999764760 521938904 -475371138 726489951 235975995 459035766 774287033 443428166 917718518 -823559601 -581993146 626920690 649872207 649764771 775091651 862891859 832301403 526656365 -874136367 -448606539 876439843 507614778 279493474 -728175218 -291624524 835926076 -188207680 582591081 -54800570 -27004750 594315431 297393461 686067118 884233920 -725166331 486466628 362140412 -903233277 -343860875 17830373 -253171574 49378914 -476240281 175957142 589718524 -693797746 585541402 -57019822 -31530487 316788907 -610646393 -126014980 -481698928 -205066677 -66314533 546435562 753860479 -565945453 826600788 25783095 …
Output: 909068691 -364116999 909068691 909068691 972052436 972052436 -722302455 972052436 976983254 23976211 520708313 521938904 -398948747 -285458783 309349374 521938904 521938904 521938904 726489951 726489951 774287033 459035766 774287033 917718518 917718518 968058003 -581993146 626920690 649872207 775091651 775091651 862891859 876439843 876439843 876439843 -448606539 876439843 884233920 835926076 835926076 -291624524 835926076 884233920 582591081 594315431 -27004750 594315431 686067118 686067118 884233920 908630064 486466628 589718524 589718524 -343860875 17830373 49378914 49378914 175957142 175957142 589718524 753860479 585541402 753860479 -31530487 316788907 546435562 -126014980 -66314533 -205066677 -66314533 546435562 753860479 826600788 826600788 908630064 241335621 356498303 59921140 35649…

Example 2:

Input: 1827 -494995929 15778119 -129767843 -241277066 -901835187 -77390559 -426027742 -247869937 607484721 279259828 779829368 -680898607 -466995924 911797427 -426971138 -446612552 -713897060 975546623 -693406576 161256681 -287989568 466963084 -767614573 657704943 468065010 -951247941 -16711971 832380347 846969683 972363115 281080143 -526335438 -839063067 -689137314 -446360104 87328410 972103210 95939003 745169254 579628459 -518450233 -728810538 -203605461 -480135822 652958099 -165071744 124065044 54195632 89293682 955911169 189741898 -604003769 -660168038 846162876 982384502 78165759 -507035684 267400288 -288953818 -645130468 738237436 -578267077 467118564 -499482621 -808146261 627777967 -888791691 453963895 455475570 -683712798 553125013 -298858027 661730230 285850379 978186858 -842121391 -3584…
Output: 15778119 607484721 -77390559 -77390559 -77390559 607484721 -247869937 607484721 779829368 779829368 911797427 -466995924 911797427 975546623 975546623 975546623 975546623 982384502 161256681 466963084 466963084 657704943 657704943 832380347 832380347 -16711971 832380347 846969683 972363115 982384502 972103210 -446360104 -689137314 -446360104 87328410 972103210 982384502 745169254 955911169 652958099 -203605461 -203605461 652958099 652958099 955911169 124065044 955911169 89293682 955911169 982384502 846162876 846162876 846162876 982384502 989132583 267400288 267400288 738237436 738237436 738237436 978186858 467118564 627777967 627777967 627777967 661730230 453963895 455475570 553125013 553125013 661730230 661730230 978186858 978186858 989132583 -358436097 635202518 867991399 -139549362 1231…

Example 3:

Input: 3502 971399984 -503529897 -964257412 -696081901 -579388339 -267187552 792358115 519008331 646305222 -61662281 -945343706 -521209935 -366387728 242829869 543196564 91209536 -869496724 -492664694 -275700512 326603781 945550438 -822673505 -659594738 -103274348 30664783 609590793 -647191667 528764176 -896839770 19006950 351560286 893483028 -204564355 -841507435 -344999811 -693631625 481546875 -719002580 365951384 -31683444 -408725472 372498850 40018925 -821833195 550984140 442124457 -158077813 -35119233 448819296 -121029152 632769832 94374589 945023051 313205723 -703873081 176363394 160299144 -871019475 -822780270 -780272045 -649304357 51470811 -488496092 -606993154 -523427601 -638164064 -36204299 -78544221 457511918 -451184947 3483588 21298253 250383605 -747126220 -948996227 276986984 9751847…
Output: 999984145 -267187552 -696081901 -579388339 -267187552 792358115 945550438 646305222 945550438 242829869 -521209935 -366387728 242829869 543196564 945550438 326603781 -492664694 -275700512 326603781 945550438 946487954 -659594738 -103274348 30664783 609590793 893483028 528764176 893483028 19006950 351560286 893483028 945023051 481546875 -344999811 481546875 481546875 550984140 365951384 372498850 372498850 372498850 550984140 550984140 550984140 632769832 448819296 -35119233 448819296 632769832 632769832 945023051 945023051 946487954 457511918 176363394 457511918 457511918 -822780270 -780272045 -649304357 51470811 457511918 -36204299 -523427601 -36204299 -36204299 457511918 457511918 632426501 3483588 21298253 250383605 276986984 276986984 276986984 632426501 632426501 26097884 632426501 75…

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Tomas's marks Reckoning - MEDIUM Coding Problem | CodeTikki