Created
October 9, 2016 13:23
-
-
Save koosaga/5063c7b2307d61287ce35a0777147115 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long lint; | |
typedef long double llf; | |
typedef pair<int, int> pi; | |
int n; | |
lint basis[60]; | |
int main(){ | |
cin >> n; | |
for(int i=0; i<n; i++){ | |
lint x; | |
scanf("%lld",&x); | |
for(int j=59; j>=0; j--){ | |
if((x >> j) & 1){ | |
if(!basis[j]){ | |
basis[j] = x; | |
break; | |
} | |
else x ^= basis[j]; | |
} | |
} | |
} | |
lint dap = 0; | |
for(int i=59; i>=0; i--){ | |
dap = max(dap, dap ^ basis[i]); | |
} | |
cout << dap; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment