CT35608

The registers at Stormrest

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Deep in the cliffside roost of Stormrest, Forester studies rows of registers entries. One clean number will settle the guild's oldest argument. 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: 1810 728476899 545548413 -938865685 892192521 375336204 -240731066 556544902 824518747 -466574984 -342088955 -330265867 617053427 -353018864 -795070466 -927226876 923583858 -13139930 -241456560 -976516004 534586094 -299163206 -956347558 -639926904 -510427067 -962039441 -185245032 813543171 -454745396 764734459 -993704674 -313647630 -87499647 91942641 -390729122 925470774 -830238937 823752985 -99841018 -388494798 -109621645 -574475628 -683924213 -299101902 226050608 -704812131 723853745 -809047678 -967267129 873486218 619984892 869471115 -655926057 90126807 16298208 924575574 208092717 -590232344 307868825 -662437624 458428455 680853447 875315183 953021659 -838861357 -919038098 -423258458 -122745073 -437737391 -713744483 943606312 -931923725 248199036 -9040871 -660190224 670703621 -66001114…
Output: 892192521 892192521 892192521 923583858 556544902 556544902 824518747 923583858 -342088955 -330265867 617053427 923583858 923583858 923583858 923583858 925470774 534586094 534586094 534586094 813543171 -185245032 -639926904 -510427067 -185245032 -185245032 813543171 925470774 764734459 925470774 -313647630 -87499647 91942641 925470774 925470774 953021659 823752985 873486218 226050608 -109621645 226050608 -299101902 -299101902 226050608 723853745 723853745 873486218 873486218 873486218 924575574 869471115 924575574 90126807 924575574 924575574 953021659 307868825 307868825 458428455 458428455 680853447 875315183 953021659 964498329 -423258458 -423258458 -122745073 943606312 943606312 943606312 946644995 248199036 670703621 670703621 670703621 946644995 -604800077 255508538 255508538 9466449…

Example 2:

Input: 3853 -347759585 177554416 565416115 -603223706 257548823 -83475545 538315052 320011651 272200417 626707252 -615730115 -195160863 -876278382 265121831 -466760468 -82671034 -200824646 315150389 -278794841 855805998 -45230406 -212967398 -352787972 410840970 -54198089 959039484 -946691348 275298944 -911408600 -898164310 536529308 454215684 -916631462 212252266 -850888633 29502559 383588648 538671379 996308581 263959683 -261025392 -205284879 185129776 475658502 -998483836 495918448 -937713318 -804050134 -78509534 -667196146 -286196491 -968001396 169885715 -710050230 430787219 549079344 633843780 344199022 -557874565 574637669 -580094110 -610923395 -194542313 -556553555 -8024845 618918487 -111840585 195267329 4834076 350286061 -167508225 350780564 522914907 625258661 -602564542 702020545 5031948…
Output: 177554416 565416115 626707252 257548823 538315052 538315052 626707252 626707252 626707252 855805998 -195160863 265121831 265121831 315150389 -82671034 315150389 315150389 855805998 855805998 959039484 410840970 410840970 410840970 959039484 959039484 996308581 275298944 536529308 -898164310 536529308 538671379 538671379 212252266 383588648 29502559 383588648 538671379 996308581 996870678 475658502 -205284879 185129776 475658502 495918448 495918448 549079344 -804050134 -78509534 169885715 -286196491 169885715 169885715 430787219 430787219 549079344 633843780 702020545 574637669 574637669 618918487 -194542313 -194542313 -8024845 -8024845 618918487 625258661 195267329 350286061 350286061 350780564 350780564 522914907 625258661 702020545 702020545 946166264 946166264 957244212 549804561 -15276…

Example 3:

Input: 223 -589003595 448104549 -725273555 -898137901 865915461 899737287 -913814214 -457946499 680572349 621399489 -477688878 718013161 -70949460 863951107 86822546 -746589967 -61978371 359167666 863190971 -309288169 427608429 -574419683 783657079 -119960393 66579070 -639585193 1273332 -835872096 402661040 41736059 -163796525 485157409 790978843 290097662 50437277 937847772 -733057806 130390865 -66911967 -963079654 357589805 -408365911 -666517132 -794937759 -852581103 -833459563 -10586401 483035145 126620701 206058735 -497941713 814495612 -701237855 -67900598 -503960015 240293337 714234160 -687958962 958891016 -393140377 -893344979 104727010 979905786 673465187 676464486 214754143 696439281 157353645 626842763 -552742708 -319114273 -973275898 -493032736 150340105 -990985109 -761073970 -372240780…
Output: 448104549 865915461 865915461 865915461 899737287 937847772 -457946499 680572349 718013161 718013161 718013161 863951107 863951107 937847772 359167666 -61978371 359167666 863190971 937847772 427608429 783657079 783657079 790978843 66579070 402661040 1273332 402661040 402661040 485157409 485157409 485157409 790978843 937847772 937847772 937847772 958891016 130390865 357589805 357589805 357589805 483035145 -10586401 -10586401 -10586401 -833459563 -10586401 483035145 814495612 206058735 814495612 814495612 958891016 -67900598 240293337 240293337 714234160 958891016 958891016 979905786 104727010 104727010 979905786 -1 676464486 696439281 696439281 814746386 626842763 814746386 -319114273 150340105 -493032736 150340105 283401809 -761073970 -372240780 -176853543 -417629515 -176853543 283401809 3…

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The registers at Stormrest - MEDIUM Coding Problem | CodeTikki