#include #include #include using namespace std; int main() { int n; cin >> n; vector a(n, 0); for (int i = 0; i < n; i++) { cin >> a[i]; } unsigned int xx = 0; unsigned int max0, max1; for (int i = 30; i >= 0; i--) { unsigned int x0 = xx; unsigned int x1 = xx + (1 << i); max0 = 0; max1 = 0; for (int j = 0; j < n; j++) { max0 = max(max0, a[j] ^ x0); max1 = max(max1, a[j] ^ x1); } xx = max0 < max1 ? x0 : x1; } int unsigned ans = max0 < max1 ? max0 : max1; cout << ans << endl; return 0; }