Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- using namespace std;
- int n, x, a[100100], cnt[100100];
- long long ans;
- int main(){
- // freopen("input.txt", "r", stdin);
- scanf("%d%d", &n, &x);
- for(int i = 0; i < n; ++i){
- scanf("%d", &a[i]);
- long long cur = a[i] ^ x;
- if(cur <= 100000)
- ans += cnt[cur];
- cnt[a[i]]++;
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement