CT47564

Corwin's signals Reckoning

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the mulberry rows of Silkmead pays by the answer, and Corwin intends to earn it. First: the full register of signals. 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: 1609 947186029 -86333669 -908568801 -317772888 -841164455 -673636252 -40257154 609131274 83138997 -954652547 680524845 17212086 -235073228 935910702 -60687459 596738231 247555152 -327705189 -751445036 -562221407 -682133069 425655270 237975058 -436636810 -273583347 -953435447 -604073686 -361494100 622639880 34390981 842174721 -924880012 -964959105 405160117 121481838 -114149937 -707544239 -378333123 -544597728 700055928 -316842627 651176206 -289129455 -228639070 -216662073 154508789 632909502 473077496 708649975 -658214893 256102918 -772611318 -309968767 -278681967 792308262 358756675 241722598 -312645608 -970606889 -40582364 -434263889 799411337 -602718186 -191307351 996697133 -374382172 -956018169 -801072758 5125597 -544053375 -392262984 -196162234 673028389 621759964 -135801599 -84820085…
Output: 996697133 -40257154 -317772888 -40257154 -673636252 -40257154 609131274 680524845 680524845 680524845 935910702 935910702 935910702 996697133 596738231 622639880 425655270 425655270 -562221407 425655270 425655270 622639880 622639880 -273583347 622639880 -604073686 -361494100 622639880 842174721 842174721 996697133 405160117 405160117 700055928 700055928 700055928 -378333123 700055928 700055928 708649975 651176206 708649975 -228639070 -216662073 154508789 632909502 708649975 708649975 792308262 256102918 792308262 -309968767 -278681967 792308262 799411337 799411337 799411337 -40582364 -40582364 799411337 799411337 996697133 -191307351 996697133 998096096 5125597 -801072758 5125597 673028389 -392262984 -196162234 673028389 763278872 763278872 206960833 -510540943 -219424333 -681408711 -57806…

Example 2:

Input: 3104 108278086 -742005383 -639702804 868383413 -165140064 -357504479 636882569 -810824924 -110279674 704633817 -327591607 416021503 -895251078 -502342142 293644370 -114030674 17081419 358071871 -877649548 -295009843 532605036 236816033 -789910261 23387166 -534180650 -519476343 720096238 393810817 -523131129 -302929507 279051575 -472827434 -742674121 394936365 -141690948 -568269013 485240619 -305029209 2540255 -949878484 -361024444 602009602 953414794 506857894 -287041588 -61481963 -357150320 321501470 13462218 980751431 945668520 460605048 282880047 882993828 201357264 215856385 -209677247 943675660 381778749 69261561 275643496 110326426 -960857557 248665881 93749231 484600125 175466567 -327379691 430301698 -742250399 474748985 -172515643 -738652621 -874782134 56204235 422021231 -787904753…
Output: 868383413 -639702804 868383413 953414794 636882569 636882569 704633817 -110279674 704633817 720096238 416021503 532605036 -502342142 293644370 358071871 17081419 358071871 532605036 -295009843 532605036 720096238 720096238 23387166 720096238 -519476343 720096238 953414794 394936365 -302929507 279051575 394936365 394936365 394936365 485240619 485240619 485240619 602009602 2540255 602009602 -361024444 602009602 953414794 980751431 980751431 -61481963 321501470 321501470 980751431 980751431 981088721 952597768 882993828 882993828 943675660 215856385 943675660 943675660 952597768 484600125 275643496 484600125 248665881 248665881 484600125 484600125 738345326 430301698 430301698 474748985 474748985 738345326 56204235 56204235 56204235 422021231 738345326 738345326 738345326 952597768 635075957 …

Example 3:

Input: 2042 -922449974 511503429 858475378 150866467 -970522734 -359252351 458702810 -168503050 -187553182 617166640 -498334620 -640456951 -94421404 442580730 898669118 126203935 266510792 985493373 321033895 -420365926 339268898 -902355931 -737630076 131726926 63153559 -538605349 -778815072 -671788873 -319343207 -782503682 513715266 850135159 -299126180 206023724 526741017 -944613096 -65001180 -709653252 -928363799 103423774 -320357473 -558653233 235658977 843164970 -875878746 -374399130 981570138 -128022522 264313737 -701681778 458050027 69995115 205687269 -937636571 -772709886 -353181211 -556436634 316119000 -384053893 -562044919 362030267 674847762 -362640282 -179434123 986705668 663953353 691869296 47318511 -293776934 -235434966 -77479930 -751989819 -634135120 684599263 -604885717 659627711 …
Output: 511503429 858475378 898669118 458702810 -359252351 458702810 617166640 617166640 617166640 898669118 -94421404 -94421404 442580730 898669118 985493373 266510792 985493373 986705668 339268898 339268898 513715266 -737630076 131726926 513715266 513715266 -319343207 -671788873 -319343207 513715266 513715266 850135159 981570138 206023724 526741017 843164970 -65001180 103423774 103423774 103423774 235658977 235658977 235658977 843164970 981570138 -374399130 981570138 986705668 264313737 458050027 458050027 674847762 205687269 316119000 -772709886 -353181211 316119000 316119000 362030267 362030267 362030267 674847762 986705668 -179434123 986705668 993428038 691869296 870956484 684599263 -235434966 -77479930 684599263 -634135120 684599263 870956484 659627711 682737501 682737501 682737501 870956484…

Constraints:

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

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