Advertisement
TimxAG

Untitled

Dec 6th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int INF=2147483647;
  5. int inf=-2147483648;
  6. int mod=1000000007;
  7. #define read(x) cin >> x;
  8. #define fo(i,n) for(i=0;i<n;i++)
  9. #define one(x) cout<<(x)<<endl;
  10. #define two(a,b) cout<<(a)<<" "<<(b)<<endl;
  11. #define three(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl;
  12. #define four(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl;
  13. #define write(a,i) cout << a[i] << " ";
  14. int main()
  15. {
  16. int n,x,uk=0,i,k;
  17. cin >> n >> x;int a[n];
  18. for (i=0;i<n;i++)
  19. {
  20. cin >> a[i];
  21. for (k=0;k<i;k++)
  22. //if ((a[i]^a[k]==x) && (sos[i]!=1) && (sos[k]!=1)) { sos[i]=1;sos[k]=1;uk++; }
  23. //cout << a[i] << " " << a[k] << " " << (a[i]^a[k]) << endl;
  24. if ((a[i]^a[k])==x) uk++;
  25. }
  26. cout << uk;
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement