P3908 XOR of a Sequence
Description
Find the value of $1 \oplus 2 \oplus\cdots\oplus N$.
$A \oplus B$ denotes the bitwise XOR of $A,B$.
Input Format
One line with an integer $N$.
Output Format
One integer, the answer.
Explanation/Hint
- For 50% of the testdata, $1 \le N \le 10^6$.
- For 100% of the testdata, $1 \le N \le 10^{18}$.
Translated by ChatGPT 5