XORray - MarisaOJ: Marisa Online Judge

XORray

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ of $n$ integers. Define function $f(l, r)$ as: $A_l$ $OR$ $A_{l+1}$ $...$ $OR$ $A_r$. Calculate XOR of all $f(l, r)$ with $1 \le l \le r \le n$. ### Input - The first line contains an integer $n$. - The second line contains $n$ integers $A_i$. ### Output - Print the result. ### Constraints - $1 \le n \le 10^6$. - $1 \le A_i \le 10^9$. ### Example Input: ``` 3 1 4 3 ``` Output: ``` 3 ```