█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 7084

Problema 0xde - Ordenar un arreglo grande

Caso # Resultado Tiempo Memoria
#1
Correcto
0.015 s 3 KBi
#2
Correcto
0.017 s 3 KBi
#3
Correcto
0.015 s 3 KBi
#4
Correcto
0.016 s 3 KBi
#5
Correcto
0.018 s 3 KBi
#6
Correcto
0.016 s 3 KBi
#7
Tiempo límite excedido
1.566 s 5 KBi
#8
Tiempo límite excedido
1.581 s 7 KBi
#9
Tiempo límite excedido
1.552 s 5 KBi
#10
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 24, in <module>
    quickSort(arr, 0, n - 1)
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  [Previous line repeated 993 more times]
  File "script.py", line 3, in quickSort
    pi = partition(array, low, high)
  File "script.py", line 11, in partition
    for j in range(low, high):
RecursionError: maximum recursion depth exceeded in comparison
1.017 s 9 KBi
#11
Tiempo límite excedido
1.523 s 14 KBi
#12
Tiempo límite excedido
1.539 s 14 KBi
#13
Tiempo límite excedido
1.56 s 14 KBi
#14
Tiempo límite excedido
1.59 s 14 KBi
#15
Tiempo límite excedido
1.567 s 14 KBi
#16
Correcto
0.442 s 14 KBi
#17
Correcto
0.475 s 14 KBi
#18
Tiempo límite excedido
1.582 s 15 KBi
#19
Tiempo límite excedido
1.582 s 14 KBi
#20
Tiempo límite excedido
1.573 s 5 KBi
#21
Tiempo límite excedido
1.507 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 24, in <module>
    quickSort(arr, 0, n - 1)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  [Previous line repeated 9 more times]
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  [Previous line repeated 981 more times]
  File "script.py", line 3, in quickSort
    pi = partition(array, low, high)
  File "script.py", line 11, in partition
    for j in range(low, high):
RecursionError: maximum recursion depth exceeded in comparison
0.447 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 24, in <module>
    quickSort(arr, 0, n - 1)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  [Previous line repeated 9 more times]
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  [Previous line repeated 981 more times]
  File "script.py", line 3, in quickSort
    pi = partition(array, low, high)
  File "script.py", line 11, in partition
    for j in range(low, high):
RecursionError: maximum recursion depth exceeded in comparison
0.445 s 14 KBi
#24
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 24, in <module>
    quickSort(arr, 0, n - 1)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  [Previous line repeated 9 more times]
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  [Previous line repeated 981 more times]
  File "script.py", line 3, in quickSort
    pi = partition(array, low, high)
  File "script.py", line 11, in partition
    for j in range(low, high):
RecursionError: maximum recursion depth exceeded in comparison
0.464 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 24, in <module>
    quickSort(arr, 0, n - 1)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  File "script.py", line 5, in quickSort
    quickSort(array, pi + 1, high)
  [Previous line repeated 9 more times]
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  File "script.py", line 4, in quickSort
    quickSort(array, low, pi - 1)
  [Previous line repeated 981 more times]
  File "script.py", line 3, in quickSort
    pi = partition(array, low, high)
  File "script.py", line 11, in partition
    for j in range(low, high):
RecursionError: maximum recursion depth exceeded in comparison
0.448 s 15 KBi
#26
Tiempo límite excedido
1.572 s 14 KBi
#27
Tiempo límite excedido
1.589 s 14 KBi
Puntos totales: 30 / 100

Código

def quickSort(array, low, high):
    if low < high:
        pi = partition(array, low, high)
        quickSort(array, low, pi - 1)
        quickSort(array, pi + 1, high)

def partition(array, low, high):
    pivot = array[high]
    i = low - 1
 
    for j in range(low, high):
        if array[j] <= pivot:
            i = i + 1
            (array[i], array[j]) = (array[j], array[i])
 
    (array[i + 1], array[high]) = (array[high], array[i + 1])
 
    return i + 1
 

n = int(input())
arr = [int(item) for item in input().split()]
 
quickSort(arr, 0, n - 1)

for i in arr:
    print(i, end=" ")