XOR sum
题号:NC54559
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

You are given two positive integers l and r,you shoud answer l⊕(l+1)⊕⋯⊕r,where ⊕ denotes the bitwise XOR operation. In XOR operation we perform the comparison of two bits, being 1 if the two bits are different, and 0 if they are the same. For example:

输入描述:

The input contain two integers l ,r (1 ≤ l ≤ r ≤1018

输出描述:

The only output line should contain a single integer
示例1

输入

复制
1 2

输出

复制
3

说明

1⊕2=3
示例2

输入

复制
3 6

输出

复制
4

说明

3⊕4⊕5⊕6=4