#include #include #include #include using namespace std; int main() { const int size = 40000; int n; cin >> n; vector ns(n); for (auto &&x: ns) cin >> x; bitset memo; for (int y = 0; y<(n+1); y++) { for (int x = 0; x<16384+1; x++) { if (y==0 && x==0) memo[x] = true; else if (y==0) memo[x] = false; else memo[x] = memo[x] || (((x^ns[y-1]) < size) ? memo[x^ns[y-1]] : false); } } // for (int x = 0; x<25; x++) cout << setw(3) << x; cout << endl; // for (int x = 0; x<25; x++) cout << setw(3) << memo[x]; cout << endl; int cnt = 0; for (int x = 0; x<16384+1; x++) cnt += memo[x]; cout << cnt << endl; }