Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. const int N = 1e5 + 5;
  6.  
  7. int a[N];
  8. int cnt[N];
  9.  
  10. int main()
  11. {
  12. #if AT_LVLS9_PC
  13.     freopen("input.txt", "r", stdin);
  14.     freopen("output.txt", "w", stdout);
  15. #endif
  16.     ios::sync_with_stdio(false);
  17.  
  18.     int n, x;
  19.     cin >> n >> x;
  20.  
  21.     long long ans = 0;
  22.     for (int i = 0; i < n; i++)
  23.     {
  24.         cin >> a[i];
  25.         cnt[a[i]]++;
  26.         ans += cnt[a[i] ^ x];
  27.     }
  28.  
  29.     cout << ans << endl;
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement