Problem1237--#113. 最大异或和

1237: #113. 最大异或和

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

这是一道模板题。
给由 $n$ 个数组成的一个可重集 $S$,求一个集合 $T \subseteq S$,使 $T_1\ \oplus\ T_2\ \oplus\ \dots\ \oplus\ T_{|T|}$ 最大。

Input

第一行一个数 $n$。
第二行 $n$ 个数,表示集合 $S$。

Output

$T_1\ \oplus\ T_2\ \oplus\ \dots\ \oplus\ T_{|T|}$ 的最大值。

Constraints

$1 \leq n \leq 50,\ 0 \leq S_i \leq 2 ^ {50}$

Sample 1 Input

3
5 2 8

Sample 1 Output

15

Source/Category