Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- #include <cstring>
- using namespace std;
- long long m[100001];
- int main() {
- int n,x,r,aux;
- long long ans=0;
- //map<long long,long long>m;
- cin>>n>>x;
- memset(m,0,sizeof(m));
- while(n--){
- cin>>r;
- aux=r^x;
- ans=ans+m[aux];
- m[r]++;
- }
- cout<<ans<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment