| JPC 4.0 |
|---|
| Finished |
Ka3bool is a very smart cat, he loves programming as much as his owner Manar does, he's also known for being a cp weapon. One day, Ka3bool challenged Manar's friend with a problem that goes as follows: "meow meow meow, meow meoow.. meowww".
The friend did not understand anything of what that silly cat said, so she asked Manar to translate it for her, and she was happy to do so.
Ka3bool Let $$$S$$$ be a set of distinct integers, and let $$$f(S)$$$ be the number of non-intersecting intervals of integers in this set. For example, if $$$S = \{1, 2, 4, 5, 6, 8\}$$$, then $$$f(S) = 3$$$, since the non-intersecting intervals are $$$[(1, 2), (4, 6), (8)]$$$.
The set is empty at first, and you have to make $$$q$$$ changes of the following form:
After each change, you have to tell Ka3bool the value of $$$f(S)$$$.
The first line of the input contains one integer $$$q (1 \leq q \leq 10^6)$$$ — the number of changes.
Then $$$q$$$ lines follow. The $$$i$$$-th line contains a character $$$c$$$ and an integer $$$x$$$ where ($$$c \in$$$ {+, -}) and $$$(0 \leq x \leq 10^{18})$$$.
After each change, output a single integer $$$f(S)$$$ — the number of non-intersecting intervals.
8+ 0+ 6+ 1- 0+ 3+ 4+ 5- 5
1 2 2 2 3 3 2 3
| Name |
|---|


