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

Envío 1903

Problema 0xcf - Mirando al horizonte

  • Autor: Francisco Guzmàn
  • Fecha: 2020-11-10 03:05:00 UTC (Hace alrededor de 2 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
0.028 s 3 KBi
#2
Incorrecto
0.021 s 3 KBi
#3
Correcto
0.02 s 3 KBi
#4
Correcto
0.024 s 3 KBi
#5
Incorrecto
0.022 s 3 KBi
#6
Incorrecto
0.766 s 38 KBi
#7
Correcto
0.484 s 15 KBi
#8
Correcto
0.585 s 52 KBi
#9
Incorrecto
0.532 s 15 KBi
#10
Incorrecto
0.547 s 55 KBi
Puntos totales: 50 / 100

Código

#!/usr/bin/python3


def looking(size_buildings, index):
    block = -1
    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)