Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.029 s | 3 KBi |
#2 |
Correcto
|
0.028 s | 3 KBi |
#3 |
Correcto
|
0.022 s | 3 KBi |
#4 |
Correcto
|
0.027 s | 3 KBi |
#5 |
Correcto
|
0.026 s | 3 KBi |
#6 |
Correcto
|
0.017 s | 3 KBi |
#7 |
Correcto
|
0.028 s | 3 KBi |
#8 |
Correcto
|
0.027 s | 3 KBi |
#9 |
Correcto
|
0.023 s | 3 KBi |
#10 |
Correcto
|
0.026 s | 3 KBi |
#11 |
Correcto
|
0.158 s | 3 KBi |
#12 |
Correcto
|
0.198 s | 3 KBi |
#13 |
Correcto
|
0.234 s | 3 KBi |
#14 |
Correcto
|
0.105 s | 3 KBi |
#15 |
Correcto
|
0.082 s | 3 KBi |
#16 |
Correcto
|
0.151 s | 3 KBi |
#17 |
Correcto
|
0.162 s | 3 KBi |
#18 |
Correcto
|
0.15 s | 3 KBi |
#19 |
Correcto
|
0.221 s | 3 KBi |
#20 |
Correcto
|
0.244 s | 3 KBi |
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().split(' '))) sorted_arr = bubblesort(arr, num_elements) print(' '.join(map(str, sorted_arr)))