Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.026 s | 3 KBi |
#2 |
Correcto
|
0.024 s | 3 KBi |
#3 |
Correcto
|
0.025 s | 3 KBi |
#4 |
Correcto
|
0.024 s | 3 KBi |
#5 |
Correcto
|
0.024 s | 3 KBi |
#6 |
Correcto
|
0.842 s | 40 KBi |
#7 |
Correcto
|
0.675 s | 20 KBi |
#8 |
Correcto
|
0.645 s | 54 KBi |
#9 |
Correcto
|
0.767 s | 12 KBi |
#10 |
Correcto
|
0.827 s | 55 KBi |
def solve(): N = int(input()) H = [int(ed) for ed in input().split()] vect = [0] * N i = N - 1 while i >= 0: vect[i] = i + 1 while vect[i] < N and H[i] >= H[vect[i]]: vect[i] = vect[vect[i]] i -= 1 for i in range(N): if vect[i] >= N: print(" -1", end="") else: print(" {}".format(H[vect[i]]), end="") print("") cases = int(input()) for i in range(1, cases+1): print("Case #{}:".format(i), end="") solve()