Bits concept , How to Crack

Problem link : CodeChef: Practical coding for everyone

Everyone solving this problem with bits concept , I know lots of things about bits but didn’t applied it in any problem.
So How to apply it in this problem Can anybody explain??

Most of the people have solved this question using Binary Indexed Tree. You can read more about it from here:
Link

An alternate approach to solving this question would be the divide and conquer strategy ( like the merge sort ) which I had used.
You can check out my solution if you wish to from here Link

2 Likes

Plz anyone help??

???

Great link, thanks, cleared my doubt. +1

thanks @nellex