CT44532

Cleo Counts the signals

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Before the gates of the zephyr cliffs of Galeholm close for winter, Cleo 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: 1213 74289192 935916356 -310265000 206344743 737598069 -103617355 577108313 268870712 -508270692 190879176 183692055 826560986 -476904871 939162461 650694380 356932525 172571710 -932742140 -216717447 315067402 198660533 -969738194 500705833 520496207 -420231653 -407068111 -555269512 -323048006 -151862821 -317340290 -681652840 -978949744 492055565 229139212 647169357 481418152 -603925274 -509941469 -720126771 -970236913 803365045 417914009 860371139 643270448 597432236 565813726 -740278649 589668288 -690101902 479362101 -9842137 300768744 -387532066 -481176340 -392254349 -436650880 350939638 171934217 440464308 -898013082 808764466 -781848421 479090409 877711117 -119806149 -557814824 653264117 -597360693 -51071287 -999154299 -625136425 70829575 -724464949 771651423 22880644 -685661347 -7158…
Output: 935916356 939162461 206344743 737598069 826560986 577108313 826560986 826560986 190879176 826560986 826560986 939162461 939162461 949861096 803365045 500705833 315067402 -216717447 315067402 500705833 500705833 500705833 520496207 647169357 -407068111 -323048006 -323048006 -151862821 492055565 492055565 492055565 492055565 647169357 647169357 803365045 803365045 -509941469 803365045 803365045 803365045 860371139 860371139 877711117 808764466 808764466 589668288 589668288 808764466 479362101 808764466 300768744 350939638 350939638 -392254349 350939638 350939638 440464308 440464308 808764466 808764466 877711117 479090409 877711117 929972414 653264117 653264117 771651423 -51071287 70829575 -625136425 70829575 771651423 771651423 929972414 679187865 -71582967 679187865 929972414 929972414 9498…

Example 2:

Input: 1510 -355878962 632941927 239797545 -275255615 -423086022 -231133504 -546103164 632371242 -288581121 -314437800 993296367 650565282 -119875174 -334031830 589058118 -11127521 453673320 -451409159 100075799 -364360577 -62719366 -646139848 748737807 -678728711 -272291149 954855947 607016881 -703802934 840130955 298368904 -860753013 57704946 -291065213 413693678 942779354 184642436 677387787 825875991 -630249913 -308075603 -287911591 92692135 -378322257 -58720600 -969206209 967714233 -438613733 -560181221 996671794 846437439 -227211503 -175174447 918814086 720450945 638341013 -580669765 607725419 -986420926 -686927292 286525635 313820166 -694175638 381604233 810134195 827656108 -367942387 65362079 -153601501 134089217 -223076687 561955798 -539783466 510747754 574327902 504283275 -590174463 527…
Output: 632941927 993296367 632371242 -231133504 -231133504 632371242 632371242 993296367 993296367 993296367 996671794 748737807 589058118 589058118 748737807 453673320 748737807 100075799 748737807 -62719366 748737807 748737807 954855947 -272291149 954855947 967714233 840130955 840130955 942779354 413693678 57704946 413693678 413693678 942779354 967714233 677387787 825875991 967714233 -308075603 -287911591 92692135 967714233 -58720600 967714233 967714233 996671794 996671794 996671794 997485807 918814086 -175174447 918814086 940800219 810134195 810134195 607725419 810134195 -686927292 286525635 313820166 381604233 381604233 810134195 827656108 940800219 65362079 134089217 134089217 561955798 561955798 574327902 510747754 574327902 615202812 527165655 527165655 615202812 615202812 690999290 732710…

Example 3:

Input: 59 -776698628 29858458 207007967 381066888 -389059378 68326906 -624116726 -415985594 145631142 929303880 -355079845 115206594 841736284 -327345222 697029060 586890348 983510504 -32281516 -608914257 -559848139 -23444683 741968801 606441329 646904683 921028267 714545711 477342002 -212817197 226768037 899268972 -564996186 373987097 -268963805 -378703551 67860446 -968801693 -6573942 433403208 452515099 -902028949 -492966183 -639321652 428236618 307478874 -129499137 158935906 921499080 69842139 -113637203 -825653639 -110491747 -925299541 -240261048 -871448220 -91895379 143906817 141225703 -844544294 -262893689
Output: 29858458 207007967 381066888 929303880 68326906 145631142 -415985594 145631142 929303880 983510504 115206594 841736284 983510504 697029060 983510504 983510504 -1 -23444683 -559848139 -23444683 741968801 921028267 646904683 921028267 921499080 899268972 899268972 226768037 899268972 921499080 373987097 433403208 67860446 67860446 433403208 -6573942 433403208 452515099 921499080 -492966183 428236618 428236618 921499080 921499080 158935906 921499080 -1 143906817 -110491747 -110491747 -91895379 -240261048 -91895379 -91895379 143906817 -1 -1 -262893689 -1

Constraints:

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

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