Processing math: 100%
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 Al⊕Al+1⊕...⊕Ar with 1≤l≤r≤n. ### Input - The first line contains an integer n. - The second line contains n integers Ai. ### Output - Print the maximum subarray XOR. ### Constraints - 1≤n≤105. - 1≤Ai≤109. ### Example Input: 512345 Output: 7