CT56044

The Gleaming signals of Kael

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Morning light hits the bamboo terraces of Verdantstep as Kael unrolls the day's manifest of signals. The tally will decide the next shipment. 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: 2895 471326299 85348086 -892186703 -18662572 -380538547 684215048 867803871 -370883744 828599145 -470393483 -788035181 153441397 372042540 376238806 175892285 -976240713 778670075 -55187129 -274458026 -408983757 -186220362 -158677082 -714334052 659599074 -57284891 -505969700 175315152 -719184390 238945207 -32960485 910612334 -911431928 373408517 881041471 125462663 -755286836 -760389497 424127471 174916802 926228095 -94420317 771008982 -772873036 -772527547 925163787 -31182634 87236929 181875276 659270687 655836331 647747171 -208658349 -617800515 -613985570 -132142395 -531719 -486166377 -338336500 416385690 194077869 -656034452 817782745 407406516 617899166 481970502 -486110229 -963544836 -273851417 -100156980 512121475 84432673 -495396712 -911816519 -662214429 -443404508 517007634 -929588…
Output: 684215048 684215048 -18662572 684215048 684215048 867803871 910612334 828599145 910612334 153441397 153441397 372042540 376238806 778670075 778670075 778670075 910612334 659599074 -186220362 -186220362 -158677082 659599074 659599074 910612334 175315152 175315152 238945207 238945207 910612334 910612334 926228095 373408517 881041471 926228095 424127471 424127471 424127471 926228095 926228095 935078041 771008982 925163787 -772527547 925163787 935078041 87236929 181875276 659270687 817782745 817782745 817782745 -132142395 -613985570 -132142395 -531719 416385690 -338336500 416385690 817782745 817782745 817782745 838153777 617899166 838153777 512121475 -273851417 -273851417 -100156980 512121475 517007634 517007634 -443404508 -662214429 -443404508 517007634 838153777 271191130 838153777 846498842…

Example 2:

Input: 3511 976224615 214232197 -41139693 -241750676 -700499774 392567405 -705974493 663132025 43435642 199592816 53759234 -875854480 212524111 79737464 -132994123 -4005875 -665341680 245730978 -390598893 -689234968 351424869 -833679518 -986427818 -894370511 308927181 687529813 239784641 414034662 972750347 523920232 210350229 -791181287 -903021246 926563204 676183573 799900841 747471238 135748582 347281712 710420180 591213386 -515127304 -400616189 -141891884 -31751266 934085141 -801014269 515605632 385906289 -566135683 56132776 -499988301 -683150726 -625965939 -605055205 298364636 396969651 -697943144 148872039 -191532140 -395639978 330751109 978959267 783814292 904518030 406607190 -710035122 -641820617 634169769 136149850 983520654 -863441581 264395423 201916552 345468067 557505124 499141061 16…
Output: 978959267 392567405 392567405 392567405 392567405 663132025 663132025 687529813 199592816 212524111 212524111 212524111 245730978 245730978 -4005875 245730978 245730978 351424869 351424869 351424869 687529813 308927181 -894370511 308927181 687529813 972750347 414034662 972750347 978959267 926563204 926563204 926563204 926563204 934085141 799900841 934085141 934085141 347281712 710420180 934085141 934085141 -400616189 -141891884 -31751266 934085141 978959267 515605632 978959267 396969651 56132776 298364636 298364636 -625965939 -605055205 298364636 396969651 978959267 148872039 330751109 330751109 330751109 978959267 983520654 904518030 983520654 634169769 -641820617 634169769 983520654 983520654 992810084 264395423 345468067 345468067 557505124 907388763 907388763 907388763 940201726 352289…

Example 3:

Input: 464 935297758 -649147817 227439314 -580788047 361253350 460204666 357068536 46620896 83968376 208437720 -754691274 367790507 -365830351 -328828989 587622628 464990632 -421799162 -376963814 245104058 913293826 279138651 429592529 -486350286 -971654088 449608488 -293228130 -502848738 -642994435 -777775839 -586719681 850457876 113996369 -339026837 627638775 390304479 -556889743 -609896925 785486989 541674883 -205586236 -977935929 420973371 629653565 -214398705 174875765 611505683 319905997 597941516 677426249 -644493066 781342020 883725260 -825117638 -96685720 91570650 -877953638 -89775580 586150841 206028695 906140689 175776856 895517638 -585094048 -941527422 -183554095 -159715864 -163457727 348969303 240483143 812266199 -814309334 -553945324 -440398270 617017670 670916419 -896207087 7243996…
Output: 962664635 227439314 361253350 361253350 460204666 587622628 367790507 83968376 208437720 367790507 367790507 587622628 -328828989 587622628 913293826 913293826 -376963814 245104058 913293826 962664635 429592529 449608488 449608488 449608488 850457876 850457876 850457876 -586719681 -586719681 850457876 883725260 627638775 627638775 785486989 785486989 785486989 785486989 883725260 629653565 420973371 420973371 629653565 677426249 174875765 611505683 677426249 597941516 677426249 781342020 781342020 883725260 906140689 -96685720 91570650 586150841 -89775580 586150841 906140689 906140689 962664635 895517638 962664635 -183554095 -183554095 -159715864 348969303 348969303 812266199 812266199 962664635 -553945324 -440398270 617017670 670916419 724399693 724399693 962664635 254320670 634547405 962…

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Gleaming signals of Kael - MEDIUM Coding Problem | CodeTikki