Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.023 s | 3 KBi |
#2 |
Incorrecto
|
0.023 s | 3 KBi |
#3 |
Incorrecto
|
0.02 s | 3 KBi |
#4 |
Incorrecto
|
0.02 s | 3 KBi |
#5 |
Incorrecto
|
0.022 s | 3 KBi |
#6 |
Incorrecto
|
0.441 s | 38 KBi |
#7 |
Incorrecto
|
0.361 s | 33 KBi |
#8 |
Incorrecto
|
0.473 s | 71 KBi |
#9 |
Incorrecto
|
0.466 s | 16 KBi |
#10 |
Incorrecto
|
0.581 s | 54 KBi |
def _solve(arr): res = [-1] * len(arr) s = [] for i, n in enumerate(arr): while s and s[-1][0] < n: _, j = s.pop() res[j] = n s.append((n, i)) return res if __name__ == "__main__": c = int(input()) for _ in range(c): N = int(input()) arr = list(map(int, input().split(" "))) print(_solve(arr))