Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.025 s | 3 KBi |
#2 |
Correcto
|
0.031 s | 3 KBi |
#3 |
Correcto
|
0.03 s | 3 KBi |
#4 |
Correcto
|
0.035 s | 3 KBi |
#5 |
Correcto
|
0.023 s | 3 KBi |
#6 |
Correcto
|
0.028 s | 3 KBi |
#7 |
Tiempo límite excedido
|
1.065 s | 4 KBi |
#8 |
Tiempo límite excedido
|
1.009 s | 6 KBi |
#9 |
Tiempo límite excedido
|
1.043 s | 4 KBi |
#10 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 38, in <module> quick_sort() File "script.py", line 8, in quick_sort qs_sort(a, left, right) File "script.py", line 17, in qs_sort qs_sort(a, left, start -1) File "script.py", line 17, in qs_sort qs_sort(a, left, start -1) File "script.py", line 18, in qs_sort qs_sort(a, start +1, right) File "script.py", line 17, in qs_sort qs_sort(a, left, start -1) File "script.py", line 18, in qs_sort qs_sort(a, start +1, right) File "script.py", line 18, in qs_sort qs_sort(a, start +1, right) File "script.py", line 18, in qs_sort qs_sort(a, start +1, right) [Previous line repeated 988 more times] File "script.py", line 16, in qs_sort start = qs_sort_section(a, left, right) File "script.py", line 25, in qs_sort_section for i in range(left, right): RecursionError: maximum recursion depth exceeded in comparison |
0.522 s | 8 KBi |
#11 |
Tiempo límite excedido
|
1.009 s | 11 KBi |
#12 |
Tiempo límite excedido
|
1.067 s | 11 KBi |
#13 |
Tiempo límite excedido
|
1.03 s | 11 KBi |
#14 |
Tiempo límite excedido
|
1.083 s | 11 KBi |
#15 |
Tiempo límite excedido
|
1.057 s | 11 KBi |
#16 |
Incorrecto
|
0.727 s | 13 KBi |
#17 |
Incorrecto
|
0.742 s | 13 KBi |
#18 |
Tiempo límite excedido
|
1.096 s | 11 KBi |
#19 |
Tiempo límite excedido
|
1.033 s | 10 KBi |
#20 |
Tiempo límite excedido
|
1.076 s | 4 KBi |
#21 |
Tiempo límite excedido
|
1.006 s | 10 KBi |
#22 |
Tiempo límite excedido
|
1.02 s | 11 KBi |
#23 |
Tiempo límite excedido
|
1.099 s | 11 KBi |
#24 |
Tiempo límite excedido
|
1.024 s | 11 KBi |
#25 |
Tiempo límite excedido
|
1.008 s | 11 KBi |
#26 |
Tiempo límite excedido
|
1.075 s | 11 KBi |
#27 |
Tiempo límite excedido
|
1.004 s | 11 KBi |
def quick_sort(): """ Using Quick sort technique """ n = int(input()) integers = input() a = integers.split(" ") left = 0 right = n -1 qs_sort(a, left, right) a = " ".join(str(number) for number in a) print(a) def qs_sort(a, left, right): """ Helper function """ if left < right: start = qs_sort_section(a, left, right) qs_sort(a, left, start -1) qs_sort(a, start +1, right) def qs_sort_section(a, left, right): """ Helper function """ pivot = a[right] element = left -1 for i in range(left, right): if a[i] < pivot: element = element +1 buffer = a[element] a[element] = a[i] a[i] = buffer buffer = a[element +1] a[element +1] = a[right] a[right] = buffer return element +1 if __name__ == "__main__": quick_sort()