problem code:Flipcoin

i want to ask I don’t know what algorithm to implement in this problem can you explained it. i almost give up on this… i tried using array of bool that give me TLE for sure. i think about bitset too but stil tle. can you help me?

Can you please give problem page link . It you are talking about Flipping Coins problems that is there in practice section , then the data structure to use is : Segment tree/binary indexed tree or square root decomposition .

Also note that Lazy Propagation trick should be used in order to perform range updates in logarithmic time… I would love to actually be able to implement this someday… Need to return to this problem…

please if anyone could explain how to apply binary indexed tree in this one?

If problem ask for the point query then it can be done in the following manner add 1 to each element in the range and when query that location take modulo with 2 ,but this problem ask for the range query .I am also curious to know the answer so can anyone answer it.

@Kuruma , Vineetpaliwal I request both of you to discuss the solution using BIT because i presonally thought a lot about this and came to a conclusion that this cannot be solved using BIT.

//