MAXXOR2


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 1G

Problem type

Cho dãy $a_1,a_2,...,a_N$.

Ta định nghĩa hàm $f(0)=0; f(x)=f(x-1) \oplus a_x$ với $x \ge 1$ và hàm $g(n+1)=0; g(x)=g(x+1) \oplus a_x$ với $x \le n$.

Tìm giá trị lớn nhất của $f(x) \oplus g(y)$ với $0\le x < y \le n+1$.

Dữ liệu

  • Dòng đầu tiên chứa số nguyên $N \ (1\le N 10^5)$;
  • Dòng thứ hai chứa $N$ số nguyên $a_i \ (0\le a_i \le 10^{12})$.

Kết quả

  • Kết quả bài toán.

Ví dụ

Ví dụ 1

input

2
1 2

output

3
Ví dụ 2

input

3
1 2 3

output

3
Ví dụ 3

input

2
1000 1000

output

1000

Comments

There are no comments at the moment.