█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 326

Problema 0xcf - Mirando al horizonte

  • Autor: Katorea132
  • Fecha: 2020-08-30 23:22:25 UTC (Hace más de 3 años)
Caso # Resultado Tiempo Memoria
#1
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.031 s 3 KBi
#2
Incorrecto
0.019 s 3 KBi
#3
Incorrecto
0.023 s 3 KBi
#4
Incorrecto
0.025 s 3 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.02 s 3 KBi
#6
Incorrecto
0.027 s 3 KBi
#7
Incorrecto
0.024 s 3 KBi
#8
Incorrecto
0.02 s 3 KBi
#9
Incorrecto
0.025 s 5 KBi
#10
Incorrecto
0.024 s 3 KBi
Puntos totales: 0 / 100

Código

buildings = int(input())
heights = input().split()
highest = 0
answers = []
local = 0

for i in range(buildings - 1, -1, -1):
    currentHeight = int(heights[i])
    if currentHeight >= highest:
        highest = currentHeight
        answers.insert(0, -1)
    elif currentHeight < local:
        answers.insert(0, local)
    else:
        local = currentHeight
        answers.insert(0, highest)
print(*answers)