#include #include #include int main() { int days; int bulls_pay; std::cin >> days >> bulls_pay; std::unordered_map xors; // xors.reserve(days); int found = 0; int num; for (int i = 0; i < days; i++) { std::cin >> num; std::vector remove; for (auto &pair : xors) { int &xnum = pair.second; xnum |= num; if (xnum > bulls_pay) remove.push_back(pair.first); else if (xnum == bulls_pay) found++; } for (size_t rem : remove) xors.erase(rem); if (num == bulls_pay) found++; if (num <= bulls_pay) xors.insert({i, num}); } std::cout << found << std::endl; return 0; }