Advertisement
repente

Untitled

Nov 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. from bisect import bisect_left, bisect_right
  2. user01 = input().split()
  3. user02 = input().split()
  4. user01 = list(map(lambda x: int(x), user01))
  5. user02 = list(map(lambda x: int(x), user02))
  6.  
  7. result = []
  8. for num in user02:
  9. left = bisect_left(user01, num)
  10. right = bisect_right(user01, num)
  11. if left == right:
  12. result.append("-1 -1")
  13. else:
  14. result.append("{} {}".format(left, right -1))
  15.  
  16. print("\n".join(result))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement