/* -*- coding: utf-8 -*- * * 130.cc: No.130 XOR Minimax - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 100000; const int MAX_B = 31; /* typedef */ /* global variables */ int as[MAX_N], zs[MAX_B], os[MAX_B]; /* subroutines */ /* main */ int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> as[i]; for (int i = 0; i < n; i++) { int &ai = as[i]; for (int j = 0, bj = 1; j < MAX_B; j++, bj <<= 1) { if (ai & bj) os[j]++; else zs[j]++; } } int ans = 0; for (int j = 0, bj = 1; j < MAX_B; j++, bj <<= 1) if (zs[j] && os[j]) ans |= bj; printf("%d\n", ans); return 0; }