Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = list(map(int, input().split())) #[2, 5, 7, 9]
- x = int(input()) #индекс первого, >= x
- l = -1
- r = len(a)
- while r - l > 1:
- m = (l + r) // 2
- if a[m] >= x:
- r = m
- else:
- l = m
- print(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement