CT41759

Mina's Northern Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the peat bogs of Mossgrieve pays by the answer, and Mina intends to earn it. First: the full register of beacons. 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: 828 -951053672 -114482384 115699824 483135954 -594372929 -623046781 473694170 -966626114 -621219217 -756976827 992774615 -984694958 57453133 582603159 716303232 -538218643 423771553 174768610 780520328 -947755398 -827172278 -770080241 306714232 579034437 221255383 -631914180 -281217301 246338096 257228798 193946079 28624618 -900413413 -588849086 -413760209 -981104566 -90694263 -155348812 851599530 -682708329 9820910 -343971583 485914280 -469375073 129915710 -750095853 -865822244 -453548287 769780637 727833588 259372521 -142733879 148526086 -729274864 152535618 -346469881 -535181968 -64689699 535696182 907555824 -441074643 271806617 329143510 -209672381 361115085 -401078091 285268831 423220775 -778196182 327844106 -409700339 143229124 872296046 -794312406 -807161353 -559046276 -515732241 94…
Output: -114482384 115699824 483135954 992774615 473694170 473694170 992774615 -621219217 992774615 992774615 997653940 57453133 582603159 716303232 780520328 423771553 780520328 780520328 851599530 -827172278 -770080241 306714232 579034437 851599530 246338096 -281217301 246338096 257228798 851599530 851599530 851599530 -588849086 -413760209 -90694263 -90694263 851599530 851599530 907555824 9820910 485914280 485914280 769780637 129915710 769780637 -453548287 -453548287 769780637 907555824 907555824 535696182 148526086 152535618 152535618 535696182 -64689699 -64689699 535696182 907555824 944000763 271806617 329143510 361115085 361115085 423220775 285268831 423220775 872296046 327844106 872296046 143229124 872296046 944000763 -559046276 -559046276 -515732241 944000763 984007939 679574540 709830038 4…

Example 2:

Input: 3844 651102419 606678108 345945345 -263879837 714208934 941651103 982967481 -370004089 -366233208 -798220769 108868696 -773746452 -224924466 344682727 -645541305 569695484 -689382287 26033331 240976833 -190888775 -7072424 340093360 -555030423 244629625 -645848907 -945871397 143107304 -260712413 -278491104 -624131144 -110967710 804912998 676253671 634115299 126070197 445699759 124801429 113397486 -199292071 567221890 648025856 -521020277 314222675 -728724529 -619566881 875945794 780431610 -57470475 817634101 34616359 -524096794 482618063 433404200 -174200678 -205701119 -641642466 709496522 581665432 832137091 602067626 386338324 727587265 -607341985 980835212 192251257 -480626421 517120649 771935337 -106990589 97767941 215684330 -206985682 -483485402 195936406 970815157 -448719323 -96158726…
Output: 714208934 714208934 714208934 714208934 941651103 982967481 998998505 -366233208 108868696 108868696 344682727 -224924466 344682727 569695484 569695484 804912998 26033331 240976833 340093360 -7072424 340093360 804912998 244629625 804912998 143107304 143107304 804912998 -110967710 -110967710 -110967710 804912998 875945794 875945794 648025856 445699759 567221890 567221890 567221890 567221890 648025856 875945794 314222675 875945794 -619566881 875945794 980835212 817634101 817634101 832137091 482618063 482618063 709496522 709496522 709496522 709496522 709496522 832137091 832137091 980835212 727587265 727587265 980835212 980835212 998998505 517120649 517120649 771935337 970815157 97767941 215684330 970815157 195936406 195936406 970815157 974528189 479530689 -577048420 479530689 889236857 889236…

Example 3:

Input: 2271 -872542970 -351572046 -684086775 -293511574 -988923755 871844108 -981923219 645843807 424158 -975938027 -750335328 -434843922 -944169640 422864758 845911878 -317235423 -316508300 587609823 -231986689 -456585429 -378373898 553854720 -909308045 653732511 -502713594 308572973 -131826126 784028865 -886798905 -833171647 -524477925 -326428978 -410972764 757497312 597688516 208843913 108631665 219244157 -435960367 -931906735 718388422 -414962982 770461179 -246118505 51526626 -381633629 314447651 -238749858 590095172 132645029 -675240270 616370818 710356250 314419796 -517488057 832991532 -618496096 -975438983 -81503957 -407700108 -845832648 399848277 -288184905 -96853800 -622191 912985028 727189312 -976760785 132304969 -931613153 -959683074 -943839999 -773797348 -242554987 -860343260 -5384154…
Output: -351572046 -293511574 -293511574 871844108 871844108 912985028 645843807 845911878 422864758 -750335328 -434843922 422864758 422864758 845911878 912985028 -316508300 587609823 653732511 553854720 -378373898 553854720 653732511 653732511 784028865 308572973 784028865 784028865 832991532 -833171647 -524477925 -326428978 757497312 757497312 770461179 718388422 219244157 219244157 718388422 718388422 718388422 770461179 770461179 832991532 51526626 314447651 314447651 590095172 590095172 616370818 616370818 616370818 710356250 832991532 832991532 832991532 912985028 -81503957 -81503957 399848277 399848277 399848277 912985028 -96853800 -622191 912985028 939315754 939315754 132304969 939315754 -773797348 -943839999 -773797348 -242554987 -17743675 -538415451 -17743675 939315754 995312048 76324678…

Constraints:

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

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