report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
XORray - FlandreOJ: Flandre 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$. - $0 \le A_i \le 10^9$. ### Example Input: ``` 3 1 4 3 ``` Output: ``` 3 ```
Bitwise operations
Trick-OR-Treat
Bitwise operations 1
Bitwise operations 2
Bitwise operations 3
XOR pair
Full
Range XOR
Cyclic shift
XOR
XORray
Minimum Xor Pair Query
Topic
Math
Bitmasks
Rating 1600
Solution (1) Solution