#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> n >> x; vll a(n); get(a); map mp; re(i, n){ auto itr = mp.find(a[i]); if(itr==mp.end()) mp.emplace(a[i], 1); else (*itr).second++; } ll ans = 0; re(i, n){ ll need = x^a[i]; auto itr = mp.find(need); if(itr==mp.end()) continue; ll cnt = (*itr).second; if(need==a[i]) cnt--; ans += cnt; } std::cout << ans/2 << '\n'; return 0; }