Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.033 s | 3 KBi |
#2 |
Correcto
|
0.026 s | 3 KBi |
#3 |
Correcto
|
0.022 s | 3 KBi |
#4 |
Correcto
|
0.02 s | 3 KBi |
#5 |
Correcto
|
0.021 s | 3 KBi |
#6 |
Correcto
|
0.035 s | 8 KBi |
#7 |
Correcto
|
0.017 s | 3 KBi |
#8 |
Correcto
|
0.02 s | 3 KBi |
#9 |
Correcto
|
0.024 s | 3 KBi |
#10 |
Correcto
|
0.021 s | 3 KBi |
import bisect def count_elements_greather_than_x(array, queries): array.sort() for x in queries: x_index = bisect.bisect_right(array, x) if x_index >= len(array): print(0) elif array[x_index - 1] <= x: print(len(array) - x_index) else: print(len(array)) array_size = int(input()) array = [int(x) for x in input().split()] number_of_queries = int(input()) queries = [int(input()) for _ in range(number_of_queries)] count_elements_greather_than_x(array, queries)