Type: Default 1000ms 64MiB

xormax

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

題目描述

給定一個由 nn 個整數所組成的數列 a1,a2,,ana_1,a_2,\dots,a_n 我們可以從中選擇任意選取一段連續的子數列 ai,ai+1,,aj1,aja_i,a_{i+1},\dots,a_{j-1},a_j,其中 1ijn1\leq i \leq j \leq n。然後進行 XOR 運算: $a_i \bigoplus a_{i+1} \bigoplus\dots \bigoplus a_{j-1}\bigoplus a_j$ (注:  \bigoplus 代表 XOR )
求我們可以得到的最大值是什麼?

輸入格式

輸入數據有兩行:

  • 第一行上有一個正整數 nn (2n200000)(2 \leq n \leq 200000)
  • 第二行上有 nn 正整數。數列中每個數字都在 [1,210)[1, 2^{10}) 範圍內。

輸出格式

輸出只有一個整數,代表你所找到的最大值。

Samples

8
5 28 98 245 11 28 90 128
254

提示

# 非官方測試數據

MOIJ 2026 模拟赛

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2026-3-12 15:00
End at
2026-3-12 17:00
Duration
2 hour(s)
Host
Partic.
12