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

Envío 1296

Problema 0xdd - Ordenar un arreglo pequeño

  • Autor: abatesins
  • Fecha: 2020-10-19 13:21:18 UTC (Hace alrededor de 4 años)
Caso # Resultado Tiempo Memoria
#1
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.022 s 3 KBi
#2
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.027 s 3 KBi
#3
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.02 s 3 KBi
#4
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.021 s 3 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.03 s 3 KBi
#6
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.028 s 3 KBi
#7
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.027 s 3 KBi
#8
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.027 s 3 KBi
#9
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.029 s 3 KBi
#10
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.029 s 3 KBi
#11
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.027 s 3 KBi
#12
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.022 s 3 KBi
#13
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.025 s 3 KBi
#14
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.02 s 3 KBi
#15
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.027 s 3 KBi
#16
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.029 s 3 KBi
#17
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.026 s 3 KBi
#18
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.023 s 3 KBi
#19
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.022 s 3 KBi
#20
Error en tiempo de ejecución (NZEC)
Exited with error status 1
  File "script.py", line 10
    arr = list(map(int, [input() for _ in range(num_elements]]))
                                                            ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
0.029 s 3 KBi
Puntos totales: 0 / 100

Código

def bubblesort(arr, num_elements):
  for i in range(num_elements-1):
    for ii in range(0, num_elements - i - 1):
      if (x0 := arr[ii]) > (x1 := arr[ii+1]):
        arr[ii:ii+2] = x1, x0
  return arr

if __name__ == "__main__":
  num_elements = int(input())
  arr = list(map(int, [input() for _ in range(num_elements]]))
  
  sorted_arr = bubblesort(arr, num_elements)
  print(' '.join(map(str, sorted_arr)))