Comments
On sukunrtUSACO training pages down?, 14 years ago
0

Thanks :)

0

In maximum XOR question: In the bit representation of l and r if the leftmost difference in their bit patterns occurs at the nth position isn't the answer simply 2^n-1?

Why do you want to do a DP?

Simply find the leftmost difference in bit representation of the two numbers. If the difference is at the nth bit the answer is 2^n — 1

Think about it.

What you want is the maximum number of different bits in the two numbers. If the leftmost difference occurring in l and r is at nth bit The remaining bits you can always make different at both positions.

http://codeforces.me/contest/276/submission/3185384