Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #define repn(i, x, y) for(int i=x; i<=y; i++)
  3. #define rep(i, x, y) for(int i=x; i<y; i++)
  4. using namespace std;
  5. int n, x, k;
  6. int a[100005], b[100005];
  7.  
  8. int main(){
  9.     cin >> n >> x;
  10.     int ans = 0;
  11.     repn(i, 1, n) {
  12.         cin >> a[i];
  13.         ans += b[a[i]];
  14.         //cout << (a[i] ^ x) << endl;
  15.         b[a[i] ^ x]++;
  16.     }
  17.     cout << ans << endl;
  18.     return 0;
  19. }
  20.  
  21.  
  22. //test for hack
  23. //20 100000
  24. //31071 31071 31071 31071 31071 31071 31071 31071 31071 31071 31071 31071 31071 31071 31071 31071 31071 31071 31071 31071
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement