I was solving a segment tree problem in witch you are given:
Update L, R. — updates [L;R] with the value of the current operation (1, 2, ... M)
Query. — count different elements in [0; N]
N <= 10^7
M <= 4 * 10^4
I couldn't come with an aproach. I will be really happy if someone helps me with it. Thankd in advance! :)