Maximum XOR subarray - MarisaOJ: Marisa Online Judge

Maximum XOR subarray

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ of $n$ integers. Find the maximum subarray XOR. In other words, find the maximum value of $A_l \oplus A_{l+1} \oplus ... \oplus A_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 maximum subarray XOR. ### Constraints - $1 \le n \le 10^5$. - $1 \le A_i \le 10^9$. ### Example Input: ``` 5 1 2 3 4 5 ``` Output: ``` 7 ```