Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.031 s | 3 KBi |
#2 |
Incorrecto
|
0.028 s | 3 KBi |
#3 |
Incorrecto
|
0.03 s | 7 KBi |
#4 |
Incorrecto
|
0.031 s | 3 KBi |
#5 |
Incorrecto
|
0.032 s | 3 KBi |
#6 |
Incorrecto
|
0.031 s | 3 KBi |
#7 |
Incorrecto
|
0.929 s | 6 KBi |
#8 |
Tiempo límite excedido
|
1.018 s | 7 KBi |
#9 |
Incorrecto
|
0.915 s | 5 KBi |
#10 |
Tiempo límite excedido
|
1.023 s | 9 KBi |
#11 |
Tiempo límite excedido
|
1.063 s | 14 KBi |
#12 |
Incorrecto
|
0.949 s | 14 KBi |
#13 |
Incorrecto
|
0.896 s | 14 KBi |
#14 |
Tiempo límite excedido
|
0.916 s | 15 KBi |
#15 |
Incorrecto
|
0.996 s | 14 KBi |
#16 |
Tiempo límite excedido
|
1.029 s | 14 KBi |
#17 |
Tiempo límite excedido
|
1.037 s | 14 KBi |
#18 |
Tiempo límite excedido
|
0.829 s | 17 KBi |
#19 |
Incorrecto
|
0.693 s | 14 KBi |
#20 |
Tiempo límite excedido
|
1.093 s | 5 KBi |
#21 |
Incorrecto
|
0.704 s | 14 KBi |
#22 |
Incorrecto
|
0.741 s | 14 KBi |
#23 |
Incorrecto
|
0.872 s | 14 KBi |
#24 |
Incorrecto
|
0.937 s | 15 KBi |
#25 |
Tiempo límite excedido
|
0.956 s | 15 KBi |
#26 |
Incorrecto
|
0.92 s | 14 KBi |
#27 |
Incorrecto
|
0.966 s | 14 KBi |
def merge(arr, left, right): arr_ptr = 0 left_ptr = 0 right_ptr = 0 while left_ptr < len(left) and right_ptr < len(right): if(left[left_ptr] < right[right_ptr]): arr[arr_ptr] = left[left_ptr] left_ptr += 1 elif (right[right_ptr] <= left[left_ptr]): arr[arr_ptr] = right[right_ptr] right_ptr += 1 arr_ptr += 1 while left_ptr < len(left): arr[arr_ptr] = left[left_ptr] left_ptr += 1 arr_ptr += 1 while right_ptr < len(right): arr[arr_ptr] = right[right_ptr] right_ptr += 1 arr_ptr += 1 def sort(arr): left = 0 right = len(arr) if len(arr) <= 1: return arr mid = (left + right) // 2 left_arr = arr[left:mid] right_arr = arr[mid:right] sort(left_arr) sort(right_arr) merge(arr, left_arr, right_arr) n = int(input()) items = [int(i) for i in input().split(" ")] sort(items) print(items) """ 0 1 2 3 4 5 1 2 3 | 4 5 6 L R | L R left: 0, right: 6, mid: 3 left: 0, right: 3, mid: 1 left: 0, right: 1 left: 2, right: 3 left: 4, right: 6, mid: 5 left: 4, right: 5, mid 4 left: 6, right: 6, mid: 6 """