这些数亦或起来是不变的。
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int cnt, n;
long long a[N], b[N], c[N], s, t;
void Insert(long long x) {
for (int i = 1; i <= cnt; ++i) {
if (!(x & (1ll << b[i])))
continue;
if (!c[i]) {
c[i] = x;
break;
}
x ^= c[i];
}
}
int main() {
scanf("%d", &n);
for (int i = 0; i < n; ++i) scanf("%lld", &a[i]), s ^= a[i];
for (int i = 62; ~i; --i)
if (!(s & (1ll << i)))
b[++cnt] = i;
for (int i = 62; ~i; --i)
if (s & (1ll << i))
b[++cnt] = i;
for (int i = 0; i < n; ++i) Insert(a[i]);
for (int i = 1; i <= cnt; ++i)
if (!(t & (1ll << b[i])))
t ^= c[i];
printf("%lld\n", s ^ t);
return 0;
}