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

Envío 328

Problema 0xcf - Mirando al horizonte

  • Autor: Katorea132
  • Fecha: 2020-08-31 00:03:07 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.028 s 3 KBi
#2
Incorrecto
0.027 s 3 KBi
#3
Incorrecto
0.027 s 3 KBi
#4
Incorrecto
0.029 s 6 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.028 s 3 KBi
#6
Incorrecto
0.03 s 3 KBi
#7
Incorrecto
0.032 s 3 KBi
#8
Incorrecto
0.026 s 3 KBi
#9
Incorrecto
0.025 s 3 KBi
#10
Incorrecto
0.027 s 3 KBi
Puntos totales: 0 / 100

Código

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

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