Hi, i was wondering how would we carry out these operation on an array using segment tree.
Formal statement of the problem.
Given an array if N positive integers, and Q queries perform these operations.
1 L R X. Decrease every element in the range [L…R] by by value X
2 L R. Return how many element in the range[L…R] are strictly greater than 0
N, Q <= 10^5
0 <= X
What information would i hsve to store in each node to get answer ?