Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- a = sorted(list(map(int, input().split())))
- x = int(input())
- l = -1 #не включительно, < x
- r = n #>= x
- while r - l > 1:
- m = (r + l) // 2
- if a[m] < x:
- l = m
- else:
- r = m
- if r == n:
- print('такого нет')
- else:
- print(r)
Advertisement
Add Comment
Please, Sign In to add comment