Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.023 s | 3 KBi |
#2 |
Incorrecto
|
0.022 s | 3 KBi |
#3 |
Incorrecto
|
0.021 s | 3 KBi |
#4 |
Incorrecto
|
0.023 s | 3 KBi |
#5 |
Incorrecto
|
0.02 s | 3 KBi |
#6 |
Incorrecto
|
0.57 s | 38 KBi |
#7 |
Incorrecto
|
0.412 s | 19 KBi |
#8 |
Incorrecto
|
0.394 s | 53 KBi |
#9 |
Incorrecto
|
0.537 s | 12 KBi |
#10 |
Incorrecto
|
0.572 s | 54 KBi |
def sol(arr , N): output = "" result = [None] * N for idx in range(N-1, -1, -1): result[idx] = idx + 1 while(result[idx] < N and arr[idx] >= arr[result[idx]]): result[idx] = result[result[idx]] for idx in range(N): if (result[idx] >= N): output += " -1" else: output += " " +str(arr[result[idx]]) return output num_cases = int(input()) for i in range(num_cases): N = int(input()) arr = [int(x) for x in input().split()] str_result = sol(arr, N) print(f"Case #{i+1}: {str_result}")