CT53166

Nina's signals Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the orchid house of Bloomglass close for winter, Nina must finish the signals ledger - one figure at a time. 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: 1175 475109446 -625131998 -787327134 994750857 -389005072 647098530 737995952 860257199 -316839111 696810839 -785863503 831249605 -314831080 -965597480 -747708108 -123218297 -771116999 -315230599 -704481670 974056740 -607120316 -215369247 980282124 -465720296 -870066260 -286335707 -778853148 445835138 254458573 52399845 290693875 546654034 -475456583 -603138842 128398578 267031520 -93299443 595141528 -799619608 -753681701 -57077249 586011941 -274135231 -294858825 -643638243 -39712136 -728823419 -506176245 -786274273 556842195 412905697 143009484 -760498366 126882839 -618201392 -401355836 83311966 -929156773 26174688 169074428 697756386 -455093360 263553811 578947906 -75284817 -48164302 -239440303 -141550508 -736911508 266827551 -823503131 226407077 898921624 194854884 156629163 750569243 2…
Output: 994750857 994750857 994750857 999712331 647098530 737995952 860257199 974056740 696810839 831249605 831249605 974056740 -123218297 -747708108 -123218297 974056740 -315230599 974056740 974056740 980282124 -215369247 980282124 999712331 -286335707 -286335707 445835138 445835138 546654034 290693875 290693875 546654034 595141528 128398578 128398578 267031520 595141528 595141528 697756386 -753681701 -57077249 586011941 697756386 -39712136 -39712136 -39712136 556842195 -506176245 556842195 556842195 697756386 697756386 169074428 126882839 169074428 -401355836 83311966 169074428 26174688 169074428 697756386 898921624 263553811 578947906 898921624 -48164302 266827551 -141550508 266827551 266827551 898921624 226407077 898921624 906043157 750569243 750569243 906043157 906043157 102251502 906043157 9…

Example 2:

Input: 1137 978070728 -825587756 419910470 -420599895 -1808089 350323221 838912899 901743827 723164342 -248907669 -243311368 984763731 -833151236 -946116124 671201811 -332045323 135396349 -311276544 -424367299 56140254 -89142071 -690473605 600768097 111225092 -713790495 -468349110 -341648204 -374811885 778171903 -36290654 -412778272 927663363 692488842 394287133 -236850033 460975426 778213112 524357838 400568218 676135271 190587582 658208412 60823390 -267617782 -733400349 -908049184 -469154177 -727135163 54150216 852780704 825540188 -694940165 122369277 864443664 58037230 313498351 842082490 654524778 -782864503 348611979 795092026 -614069166 183091380 -248151572 611151129 547835157 32485139 -690135146 667335460 -186000622 -223947281 -147034909 -180312716 -283483903 -213713684 -766460626 54557263…
Output: 984763731 419910470 838912899 -1808089 350323221 838912899 901743827 984763731 984763731 -243311368 984763731 996839585 671201811 671201811 778171903 135396349 600768097 56140254 56140254 600768097 600768097 600768097 778171903 778171903 -468349110 -341648204 778171903 778171903 927663363 927663363 927663363 982232214 778213112 460975426 460975426 778213112 852780704 676135271 676135271 852780704 658208412 852780704 852780704 54150216 -469154177 -469154177 54150216 54150216 852780704 864443664 864443664 122369277 864443664 982232214 313498351 842082490 982232214 795092026 348611979 795092026 811130773 183091380 611151129 611151129 667335460 667335460 667335460 667335460 811130773 -147034909 -147034909 545572638 545572638 -213713684 545572638 545572638 811130773 982232214 237437922 23743792…

Example 3:

Input: 553 -684804786 799847377 924291184 -451941925 91222961 339845746 487456733 -167699364 -642728425 829269923 209189526 783830501 161940369 828176911 -118088142 -474661899 -11210034 535200136 330566197 -128112433 -176140730 -328133495 986001883 677032326 -940582488 -393134543 372268752 262701235 -183259777 -574143302 517356723 -557380231 896296752 -512009261 696661063 -262007932 -510882061 193518353 -510850457 -719559946 -252933608 -994848922 778528562 630168474 -897352029 -463537078 -224748294 217092007 24741135 -26273545 656896502 618410736 258187149 -773502004 -332930181 534739840 625510359 -482340092 -926587815 417044258 878216864 575074636 810754336 397871360 -641182223 978095952 211161919 -221298124 -265233580 168479368 -433694837 878276070 -631896965 -349762212 58861476 133637046 59590…
Output: 799847377 924291184 986001883 91222961 339845746 487456733 829269923 829269923 829269923 986001883 783830501 828176911 828176911 986001883 -11210034 -11210034 535200136 986001883 986001883 986001883 986001883 986001883 997575276 896296752 -393134543 372268752 517356723 517356723 517356723 517356723 896296752 896296752 978095952 696661063 778528562 193518353 193518353 778528562 -252933608 -252933608 778528562 778528562 878216864 656896502 -463537078 -224748294 217092007 656896502 656896502 656896502 878216864 625510359 534739840 -332930181 534739840 625510359 878216864 417044258 417044258 878216864 978095952 810754336 978095952 978095952 978095952 997575276 878276070 168479368 168479368 878276070 878276070 976251357 -349762212 58861476 133637046 595902044 758884432 761710211 504750046 50475…

Constraints:

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

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