p275.cpp
======================
#include <bits/stdc++.h>
#define endl '\n'

// #pragma GCC optimize ("O3")
// #pragma GCC target ("sse4")

using namespace std;
template<class T, class T2>
inline void chkmax(T& x, const T2& y) {
    if(x < y) {
        x = y;
    }
}
template<class T, class T2>
inline void chkmin(T& x, const T2& y) {
    if(x > y) {
        x = y;
    }
}
const int MAXN = (1 << 20);

int n;
int64_t base[64];

void add(int64_t x) {
    for(int64_t l = 60; l >= 0; l--) {
        if((x & (1ll << l)) && base[l] == 0) {
            base[l] = x;
            return;
        } else if(x & (1ll << l)) {
            x ^= base[l];
        }
    }
}

int64_t max_xor() {
    int64_t x = 0;
    for(int64_t l = 60; l >= 0; l--) {
        if(!(x & (1ll << l))) {
            x ^= base[l];
        }
    }

    return x;
}

void read() {
    cin >> n;
    for(int i = 0; i < n; i++) {
        int64_t x;
        cin >> x;
        add(x);
    }
}

void solve() { cout << max_xor() << endl; }

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    read();
    solve();
    return 0;
}

=================
statement.txt
======================
275. To xor or not to xor
time limit per test: 0.25 sec.
memory limit per test: 65536 KB
input: standard
output: standard



The sequence of non-negative integers A1, A2, ..., AN is given. You are to find some subsequence Ai1, Ai2, ..., Aik (1 <= i1 < i2 < ... < ik <= N) such, that Ai1 XOR Ai2 XOR ... XOR Aik has a maximum value.

Input
The first line of the input file contains the integer number N (1 <= N <= 100). The second line contains the sequence A1, A2, ..., AN (0 <= Ai <= 10^18).

Output
Write to the output file a single integer number -- the maximum possible value of Ai1 XOR Ai2 XOR ... XOR Aik.

Sample test(s)

Input
3
11 9 5

Output
14
Author:	Michael R. Mirzayanov
Resource:	ACM ICPC 2004-2005, NEERC, Southern Subregional Contest
Date:	Saratov, October 7, 2004






=================
