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

Envío 1902

Problema 0xcf - Mirando al horizonte

  • Autor: Francisco Guzmàn
  • Fecha: 2020-11-10 02:37:00 UTC (Hace alrededor de 4 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
0.022 s 3 KBi
#2
Incorrecto
0.025 s 3 KBi
#3
Correcto
0.025 s 3 KBi
#4
Correcto
0.02 s 3 KBi
#5
Incorrecto
0.02 s 3 KBi
#6
Incorrecto
0.61 s 38 KBi
#7
Correcto
0.524 s 15 KBi
#8
Correcto
0.514 s 52 KBi
#9
Incorrecto
0.638 s 15 KBi
#10
Incorrecto
0.517 s 55 KBi
Puntos totales: 50 / 100

Código

#!/usr/bin/python3


def looking(size_buildings, index):
    block = 0
    output = []
    for i in reversed(range(len(size_buildings))):
        if size_buildings[i] >= block:
            output.append(-1)
            block = size_buildings[i]
        else:
            output.append(block)

    print("Case #{}:".format(index), end="")
    for i in reversed(range(len(output))):
        print(end=" ")
        print(output[i], end="")
    print()


cases = int(input())
size_buildings = []
buildings = 0

for i in range(cases):
    buildings = int(input())
    size_buildings = input().split()
    size_buildings = list(map(int, size_buildings))
    looking(size_buildings, i + 1)