Advertisement
nolog1n

Untitled

May 7th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. def try2():
  2. timestamps = [None for _ in range(32768)]
  3. count = int(input())
  4.  
  5. for c in range(count):
  6. start, end, delegated = [int(x) for x in input().split()]
  7. add = 1 + delegated
  8. if timestamps[start]:
  9. timestamps[start][0] += add
  10. else:
  11. timestamps[start] = [add,0]
  12. if timestamps[end]:
  13. timestamps[end][1] += add
  14. else:
  15. timestamps[end] = [0,add]
  16.  
  17. result = 0
  18. guests = 0
  19.  
  20. for t in timestamps:
  21. if t:
  22. add, remove = t
  23. guests += add
  24. result = max(result,guests)
  25. guests -= remove
  26.  
  27. print(result)
  28.  
  29. try2()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement