Bounded XOR Count
Count the integers i in [0, N] such that i XOR X is at most Y.
Input: one line with three integers N, X, Y.
Output: the count of qualifying i.
Constraints:
- 0 ≤ N, X, Y ≤ 1012
Sample Tests
Input 1
5 3 4
Output 1
4
Input 2
0 0 0
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.