Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.035 s | 3 KBi |
#2 |
Correcto
|
0.051 s | 4 KBi |
#3 |
Correcto
|
0.033 s | 3 KBi |
#4 |
Correcto
|
0.055 s | 3 KBi |
#5 |
Correcto
|
0.027 s | 7 KBi |
#6 |
Correcto
|
0.021 s | 3 KBi |
#7 |
Correcto
|
0.021 s | 3 KBi |
#8 |
Correcto
|
0.039 s | 3 KBi |
#9 |
Correcto
|
0.048 s | 3 KBi |
#10 |
Correcto
|
0.026 s | 4 KBi |
#11 |
Correcto
|
0.034 s | 6 KBi |
#12 |
Correcto
|
1.124 s | 9 KBi |
#13 |
Correcto
|
0.63 s | 5 KBi |
#14 |
Correcto
|
0.689 s | 14 KBi |
#15 |
Correcto
|
0.66 s | 14 KBi |
#16 |
Correcto
|
0.469 s | 14 KBi |
#17 |
Correcto
|
0.615 s | 14 KBi |
def _first_greater(arr, target): res = len(arr) l, r = 0, len(arr) - 1 while l <= r: m = (l + r) >> 1 if arr[m] > target: res = m r = m - 1 else: l = m + 1 return res _ = int(input()) l = list(map(int, input().split(" "))) qs = int(input()) for _ in range(qs): print(_first_greater(l, int(input())))