Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.022 s | 3 KBi |
#2 |
Correcto
|
0.021 s | 3 KBi |
#3 |
Correcto
|
0.028 s | 3 KBi |
#4 |
Correcto
|
0.024 s | 3 KBi |
#5 |
Correcto
|
0.021 s | 3 KBi |
#6 |
Correcto
|
0.027 s | 3 KBi |
#7 |
Tiempo límite excedido
|
0.694 s | 4 KBi |
#8 |
Tiempo límite excedido
|
0.851 s | 7 KBi |
#9 |
Tiempo límite excedido
|
0.634 s | 5 KBi |
#10 |
Tiempo límite excedido
|
0.729 s | 9 KBi |
#11 |
Tiempo límite excedido
|
1.073 s | 14 KBi |
#12 |
Tiempo límite excedido
|
1.04 s | 14 KBi |
#13 |
Tiempo límite excedido
|
0.703 s | 14 KBi |
#14 |
Tiempo límite excedido
|
0.753 s | 14 KBi |
#15 |
Tiempo límite excedido
|
0.758 s | 14 KBi |
#16 |
Correcto
|
0.537 s | 15 KBi |
#17 |
Correcto
|
0.475 s | 15 KBi |
#18 |
Tiempo límite excedido
|
0.603 s | 15 KBi |
#19 |
Tiempo límite excedido
|
0.525 s | 14 KBi |
#20 |
Tiempo límite excedido
|
0.886 s | 5 KBi |
#21 |
Tiempo límite excedido
|
0.529 s | 14 KBi |
#22 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 28, in <module> quicksort(arr) File "script.py", line 23, in quicksort _quicksort(arr, 0, len(arr) - 1) File "script.py", line 20, in _quicksort _quicksort(arr, pivot + 1, high) File "script.py", line 20, in _quicksort _quicksort(arr, pivot + 1, high) File "script.py", line 20, in _quicksort _quicksort(arr, pivot + 1, high) [Previous line repeated 9 more times] File "script.py", line 19, in _quicksort _quicksort(arr, low, pivot - 1) File "script.py", line 19, in _quicksort _quicksort(arr, low, pivot - 1) File "script.py", line 19, in _quicksort _quicksort(arr, low, pivot - 1) [Previous line repeated 980 more times] File "script.py", line 18, in _quicksort pivot = partition(arr, low, high) File "script.py", line 6, in partition for j in range(low, high): RecursionError: maximum recursion depth exceeded in comparison |
0.418 s | 14 KBi |
#23 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 28, in <module> quicksort(arr) File "script.py", line 23, in quicksort _quicksort(arr, 0, len(arr) - 1) File "script.py", line 20, in _quicksort _quicksort(arr, pivot + 1, high) File "script.py", line 20, in _quicksort _quicksort(arr, pivot + 1, high) File "script.py", line 20, in _quicksort _quicksort(arr, pivot + 1, high) [Previous line repeated 9 more times] File "script.py", line 19, in _quicksort _quicksort(arr, low, pivot - 1) File "script.py", line 19, in _quicksort _quicksort(arr, low, pivot - 1) File "script.py", line 19, in _quicksort _quicksort(arr, low, pivot - 1) [Previous line repeated 980 more times] File "script.py", line 18, in _quicksort pivot = partition(arr, low, high) File "script.py", line 6, in partition for j in range(low, high): RecursionError: maximum recursion depth exceeded in comparison |
0.44 s | 14 KBi |
#24 |
Tiempo límite excedido
|
0.492 s | 15 KBi |
#25 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 28, in <module> quicksort(arr) File "script.py", line 23, in quicksort _quicksort(arr, 0, len(arr) - 1) File "script.py", line 20, in _quicksort _quicksort(arr, pivot + 1, high) File "script.py", line 20, in _quicksort _quicksort(arr, pivot + 1, high) File "script.py", line 20, in _quicksort _quicksort(arr, pivot + 1, high) [Previous line repeated 9 more times] File "script.py", line 19, in _quicksort _quicksort(arr, low, pivot - 1) File "script.py", line 19, in _quicksort _quicksort(arr, low, pivot - 1) File "script.py", line 19, in _quicksort _quicksort(arr, low, pivot - 1) [Previous line repeated 980 more times] File "script.py", line 18, in _quicksort pivot = partition(arr, low, high) File "script.py", line 6, in partition for j in range(low, high): RecursionError: maximum recursion depth exceeded in comparison |
0.411 s | 15 KBi |
#26 |
Tiempo límite excedido
|
0.656 s | 14 KBi |
#27 |
Tiempo límite excedido
|
0.625 s | 14 KBi |
# https://www.geeksforgeeks.org/quick-sort/?ref=lbp def partition(arr, low, high): i = low - 1 pivot = arr[high] for j in range(low, high): if arr[j] <= pivot: i += 1 arr[i], arr[j] = arr[j], arr[i] arr[i + 1], arr[high] = arr[high], arr[i + 1] return i + 1 def _quicksort(arr, low, high): if len(arr) == 1: return arr if low < high: pivot = partition(arr, low, high) _quicksort(arr, low, pivot - 1) _quicksort(arr, pivot + 1, high) def quicksort(arr): _quicksort(arr, 0, len(arr) - 1) if __name__ == "__main__": n = input() arr = list(map(int, input().split(" "))) quicksort(arr) print(" ".join(map(str, arr)))