Codeforces Round #366 (Div. 2) C. Thor (模擬)
阿新 • • 發佈:2018-12-31
Thor is getting used to the Earth. As a gift Loki gave him a smartphone. There are n applications on this phone. Thor is fascinated by this phone. He has only one minor issue: he can't count the number of unread notifications generated by those applications (maybe Loki put a curse on it so he can't).
q events are about to happen (in chronological order). They are of three types:
- Application x generates a notification (this new notification is unread).
- Thor reads all notifications generated so far by application x (he may re-read some notifications).
-
Thor reads the first t notifications generated by phone applications (notifications generated in first t
Please help Thor and tell him the number of unread notifications after each event. You may assume that initially there are no notifications in the phone.