Hello! I'm facing some difficulties here in this problem. I thought it would be a straightforward data structure problem. But the memory constraints here made me about to cry. Is there any way to cut the problem down to a 1D BIT?
Problem link: SPOJ — CCOST