Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = list(map(int, input().split()))
- n = len(a)
- x = int(input()) #найти индекс первого >= x
- l = -1 #не подходят
- r = n #подходят
- 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