I have a problem that reduces to doing 2 kinds of queries:
- Add a number in $$${1,-1}$$$ to a range.
- Query the number of 0s in a suffix. It's guranteed that the array is nonnegative.
Constraints: $$$n\leq 10^5, Q\leq 192\cdot10^5$$$. My best solution did this problem in about 3.5 seconds using sqrt decomposition.



