Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.02 s | 3 KBi |
#2 |
Correcto
|
0.02 s | 3 KBi |
#3 |
Correcto
|
0.021 s | 3 KBi |
#4 |
Correcto
|
0.02 s | 3 KBi |
#5 |
Correcto
|
0.029 s | 3 KBi |
#6 |
Tiempo límite excedido
|
0.448 s | 37 KBi |
#7 |
Correcto
|
0.523 s | 45 KBi |
#8 |
Correcto
|
0.562 s | 59 KBi |
#9 |
Tiempo límite excedido
|
0.489 s | 28 KBi |
#10 |
Correcto
|
0.598 s | 61 KBi |
def sol(arr , N): frontier = [] result = [None] * N for idx in range(N-1, -1, -1): while(len(frontier) > 0 and arr[idx] >= frontier[-1]): _ = frontier.pop() cover = -1 if len(frontier) == 0 else frontier[-1] frontier.append(arr[idx]) result[idx] = cover return result num_cases = int(input()) for i in range(num_cases): N = int(input()) arr = [int(x) for x in input().split()] result = sol(arr, N) str_result = ' '.join([str(x) for x in result]) print(f"Case #{i+1}: {str_result}")