Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.04 s | 4 KBi |
#2 |
Incorrecto
|
0.032 s | 4 KBi |
#3 |
Incorrecto
|
0.033 s | 4 KBi |
#4 |
Incorrecto
|
0.035 s | 4 KBi |
#5 |
Correcto
|
0.091 s | 9 KBi |
#6 |
Incorrecto
|
0.031 s | 3 KBi |
#7 |
Incorrecto
|
0.071 s | 4 KBi |
#8 |
Incorrecto
|
0.034 s | 4 KBi |
#9 |
Incorrecto
|
0.038 s | 4 KBi |
#10 |
Incorrecto
|
0.037 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; for i in range(n): current_c = c_list_dict_keys[c_index] ni = list_n[i] if ni > current_c: c_list_dict[current_c] = n - i c_index += 1 if c_index == len(c_list_dict_keys) - 1 and c_list_dict_keys[c_index] > ni: break for i in range(len(c_list)): print(c_list_dict[c_list[i]])