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

Envío 1452

Problema 0xcf - Mirando al horizonte

  • Autor: Serivt
  • Fecha: 2020-10-27 22:59:17 UTC (Hace más de 3 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
0.019 s 3 KBi
#2
Correcto
0.018 s 3 KBi
#3
Correcto
0.026 s 3 KBi
#4
Correcto
0.02 s 3 KBi
#5
Correcto
0.026 s 3 KBi
#6
Tiempo límite excedido
1.066 s 38 KBi
#7
Tiempo límite excedido
1.039 s 12 KBi
#8
Tiempo límite excedido
1.088 s 53 KBi
#9
Tiempo límite excedido
1.04 s 12 KBi
#10
Tiempo límite excedido
1.022 s 54 KBi
Puntos totales: 50 / 100

Código

cases = int(input())
for c in range(0, cases):
    n = int(input())
    a = list(map(int, input().split(" ")))
    output = []
    max_cache = []
    for i in range(n - 1, -1, -1):
        max_a = -1
        for j in range(i, n):
            if a[j] > a[i]:
                max_a = a[j]
                break
        output.append(max_a)
    output = reversed(list(map(str, output)))
    print("Case #%d: %s" % (c + 1, " ".join(output)))