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

Envío 1904

Problema 0xcf - Mirando al horizonte

  • Autor: Francisco Guzmàn
  • Fecha: 2020-11-10 03:07:21 UTC (Hace alrededor de 4 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
0.025 s 3 KBi
#2
Incorrecto
0.018 s 3 KBi
#3
Correcto
0.019 s 3 KBi
#4
Correcto
0.019 s 3 KBi
#5
Incorrecto
0.018 s 3 KBi
#6
Incorrecto
0.489 s 38 KBi
#7
Correcto
0.448 s 15 KBi
#8
Correcto
0.571 s 52 KBi
#9
Incorrecto
0.515 s 15 KBi
#10
Incorrecto
0.551 s 54 KBi
Puntos totales: 50 / 100

Código

#!/usr/bin/python3


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