report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Range XOR - MarisaOJ: Marisa Online Judge

Range XOR

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ consisting of $n$ integers. Count the number of contiguous subarrays such that the XOR sum of all elements in the subarray has an odd number of set bits. ### Input - The first line contains an integer $n$. - The second line contains $n$ integers $A_i$. ### Output - Print an integer, the number of contiguous subarrays satisfying the condition. ### Constraints - $1 \leq n \leq 10^6$. - $1 \leq A_i \leq 10^9$. ### Example Input: ``` 3 1 2 4 ``` Output: ``` 4 ```
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
Bitmasks
Rating 1300
Source HackerEarth
Solution (2) Solution