#include #include #include #include int main() { int switches; std::cin >> switches; std::set s; for (int i = 0; i < switches;i++){ int num; std::cin >> num; s.insert(num); } // 排他的論理和は%で置き換えることができる bool ans[32768] = {false}; ans[0] = true; for (std::set::iterator it = s.begin(); it != s.end(); ++it) { for (int j = 0; j < 32768; j++) { if(ans[j]) ans[j ^ *it] = true; } } int a = 0; for (int i = 0; i < 32768; i++) { a += ans[i]; } std::cout << a << std::endl; return 0; }