CT42441

Gita's Ledger of registers

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the opal reefs of Shimmerdeep; Gita weighs the day's registers manifests and starts the calculations. 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: 3895 915851482 2815211 429774436 980850934 -347348953 243331716 525485662 419826504 597951730 -714136233 327101758 -815204720 -228368446 65087958 441416454 -651242883 747771754 235573633 425341258 -191917027 -973597874 43111555 790737837 -593914630 -427821622 850539129 965734713 -286155586 -7531381 -61891745 -573280891 599104660 468708620 -604273541 -276529387 50657816 -646015075 -211193642 -582284261 -808334338 831207925 -844716570 398430609 -604495939 468748652 -167132935 413539775 -160917807 380252151 382687409 -506432818 -590054893 693101356 -903894401 -909338952 -687348716 291947202 128619803 144627486 -883548297 -692711661 651866774 -467368590 218250451 -8826946 -133742154 8193759 751111427 807319705 -705618455 627021954 -928299780 224517243 372857867 -907911512 959636255 -793023389 …
Output: 980850934 429774436 980850934 993011861 243331716 525485662 597951730 597951730 747771754 327101758 441416454 -228368446 65087958 441416454 747771754 747771754 790737837 425341258 790737837 43111555 43111555 790737837 850539129 -427821622 850539129 965734713 993011861 -7531381 599104660 599104660 599104660 831207925 831207925 -276529387 50657816 831207925 -211193642 831207925 831207925 831207925 959636255 398430609 468748652 468748652 693101356 413539775 693101356 380252151 382687409 693101356 693101356 693101356 751111427 -687348716 -687348716 291947202 651866774 144627486 651866774 -692711661 651866774 751111427 218250451 751111427 8193759 8193759 751111427 807319705 959636255 627021954 959636255 224517243 372857867 959636255 959636255 993011861 -705138258 531832223 610728678 309730380 3…

Example 2:

Input: 1925 -501221651 -781537973 -950384503 318045403 578431905 -923153054 -114861255 527460321 906053669 699470636 2790927 -663137423 -395461724 -990064412 -395576237 -49237875 -284079044 -743121024 284025750 265301565 -657059636 216098314 -958827055 -246913399 -11971188 -732022964 579537068 -880519642 -127948836 -93616922 473446884 715207809 -816366271 -251565970 -426313395 488060858 -158856795 347839409 83650272 -976500412 -422946241 -893723239 -71244614 -598742799 -65596508 -669637907 712531008 341177432 -260123718 -116421486 -923634693 186211273 587127401 -580732843 -399778326 860113095 255700632 -552046733 -596338827 -340186279 -26202156 639571321 770874833 -703634480 -396435305 -930896285 540775765 -399600193 480612563 371104505 976454210 936175749 484317612 -36757590 -707712527 -19773570…
Output: 318045403 318045403 318045403 578431905 906053669 -114861255 527460321 906053669 976454210 715207809 284025750 -395461724 -49237875 -395576237 -49237875 284025750 284025750 284025750 579537068 579537068 216098314 579537068 -246913399 -11971188 579537068 579537068 715207809 -127948836 -93616922 473446884 715207809 860113095 -251565970 488060858 488060858 712531008 347839409 712531008 712531008 -422946241 -71244614 -71244614 -65596508 -65596508 712531008 712531008 860113095 587127401 -116421486 186211273 186211273 587127401 860113095 -399778326 860113095 976454210 639571321 -340186279 -340186279 -26202156 639571321 770874833 976454210 -396435305 540775765 540775765 976454210 480612563 976454210 976454210 997969098 975312227 635601422 -5004938 -197735705 -5004938 94302105 94302105 635601422 7…

Example 3:

Input: 3100 630390086 -168054782 229795997 194254298 -532975185 -960945267 847725970 -504844326 904877307 759610795 -438531078 -785578778 697130753 -367838949 -572472935 -95953294 -148942946 763856061 -954243895 941074803 -891999080 -727931312 693301894 299489833 980687892 -670223408 392621127 93916029 243828692 -377854840 411626908 -485721614 -493517141 -317263819 401822165 366755768 -478307766 -44933802 -472031662 926081 265784068 -553785951 893077025 983662376 -773634745 -664566979 -980670407 -630708749 490482960 733025456 59176851 301610644 -573422340 818399356 258977856 -52630937 364772553 -822597212 942220634 952775678 117064853 521415570 -191710178 651532683 -9602137 -440457005 158319120 -60842542 20708925 -431243073 -501299719 190936659 564797882 -976762873 -217449301 786688593 590712769 …
Output: 847725970 229795997 847725970 847725970 847725970 847725970 904877307 904877307 941074803 763856061 697130753 697130753 763856061 -95953294 -95953294 763856061 763856061 941074803 941074803 980687892 -727931312 693301894 980687892 980687892 983662376 392621127 411626908 243828692 411626908 411626908 893077025 -317263819 -317263819 401822165 893077025 893077025 -44933802 926081 926081 265784068 893077025 893077025 983662376 991655625 -664566979 -630708749 -630708749 490482960 733025456 818399356 301610644 818399356 818399356 942220634 364772553 364772553 942220634 942220634 952775678 965051731 521415570 651532683 651532683 786688593 158319120 158319120 190936659 20708925 190936659 190936659 190936659 564797882 786688593 -217449301 786688593 909078438 909078438 234290944 292094922 909078438 …

Constraints:

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

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