Comment

avatar username

There's actually no need of a Fenwick/segment tree. I used prefix sums since l and r can be atmost 2n. You can check my submission.

The actual rating of this user is 1596.

Original comment.

Statistics