- Thoughts.
- If you think about each bit individually, you can figure out the number of 1’s in the interval by the remainder of the power of 2, right?
- Official Explanation
- It is a logarithmic order solution
- Constant order if you notice the following
- - Arbitrary interval is the difference between intervals from 0
- - XOR of an even number and the next odd number is 1
This page is auto-translated from /nishio/ABC121D using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.