Advertisement
konchin_shih

3

Aug 6th, 2020 (edited)
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. a[n]
  2. multiset s(a)
  3. lazy = 0
  4. while n--:
  5.     op, k = input()
  6.     switch op:
  7.     case 1:
  8.         s.insert(k)
  9.     case 2:
  10.         lazy += k
  11.     case 3:
  12.         s.erase(s.lower_bound(k-lazy), s.end())
  13. for i in s:
  14.     print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement