Bit manipulation Hackerearth problem

Can anyone help me in this question? I am getting TLE for 6 out of 10 test cases.
the question link is:

how are you solving this exactly?

Using simple approach, updating array elements with each passing operations

see , when you ask someone why I am getting TLE you should either tell your approach or show the code (this one is preferred).

Based on your comment it looks like you are using brute force approach so getting TLE is only obvious in this problem because we have to handle queries here.

I think this problem can be solved using this logic :

instead of add you have to perform AND operation.