About 2D Bits query/update

Revision en3, by Medo., 2017-11-21 02:33:44

Hello recently I attempted this problem: http://codeforces.net/contest/341/problem/D

I understand editorial's solution, but I found in comments a very nice solution, that appears it can be generalized to query sums or higher dimensions. Here is it.

Spoiler

Link to code : http://codeforces.net/contest/341/submission/4391987

I could only get a vague idea, but not much into detail of what's going on especially the code. With this being a 4 years old comment, I don't think it's a good idea to ask the guy who posted, but can anyone please clarify in an easier way, or provide similar problems/blogs to it? Perhaps how to solve this problem if it was for sum queries instead of xor using this technique.

Thanks.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English Medo. 2017-11-21 02:33:44 21 Tiny change: 'ead of xor.\n\nThank' -> 'ead of xor using this technique.\n\nThank'
en2 English Medo. 2017-11-21 02:32:42 7
en1 English Medo. 2017-11-21 02:32:12 1551 Initial revision (published)