Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.047 s | 4 KBi |
#2 |
Incorrecto
|
0.042 s | 4 KBi |
#3 |
Incorrecto
|
0.043 s | 4 KBi |
#4 |
Incorrecto
|
0.089 s | 8 KBi |
#5 |
Correcto
|
0.035 s | 4 KBi |
#6 |
Incorrecto
|
0.084 s | 4 KBi |
#7 |
Incorrecto
|
0.04 s | 3 KBi |
#8 |
Correcto
|
0.032 s | 4 KBi |
#9 |
Incorrecto
|
0.034 s | 4 KBi |
#10 |
Incorrecto
|
0.04 s | 4 KBi |
import re n = int(input()) list_n = [int(x) for x in re.findall("-?\d", input())] c = int(input()) c_list = [int(input()) for _ in range(c)] list_n.sort() c_list_dict = {key: 0 for key in sorted(c_list)} c_list_dict_keys = list(c_list_dict.keys()) c_index = 0 current_c = c_list_dict_keys[c_index] for i in range(n): ni = list_n[i] while ni > current_c: c_list_dict[current_c] = n - i c_index += 1 if (c_index < len(c_list_dict_keys)): current_c = c_list_dict_keys[c_index] else: break for i in range(len(c_list)): print(c_list_dict[c_list[i]])