mfgnik

Untitled

May 29th, 2020
718
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. interesting_points = []
  2. points = []
  3. table_length, socks_amt, places_amt = map(int, input().split())
  4. for sock in range(socks_amt):
  5.     left, right = map(int, input().split())
  6.     points.append((left, -1))
  7.     points.append((right, 1))
  8. for place in range(places_amt):
  9.     interesting_points.append(int(input()))
  10.     points.append((interesting_points[-1], 0))
  11. points.sort()
  12. coverage = 0
  13. results = {}
  14. for x in points:
  15.     if x[1] == 0:
  16.         results[x[0]] = coverage
  17.     coverage -= x[1]
  18. for x in interesting_points:
  19.     print(results[x])
Advertisement
Add Comment
Please, Sign In to add comment