标签:运算 异或运算 namespace dad names += include 超时 pac
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn = 1e6 + 10;
int a[maxn],sum[maxn];
int main()
{
int n,x,y,z;
ll ans = 0;
cin>>n>>x;
for(int i=0;i<n;i++)cin>>a[i];
for(int i=0;i<n;i++){
z = x^a[i];
if(sum[z])
ans += 1ll*sum[z];
sum[a[i]]++;
}
cout<<ans<<endl;
return 0;
}
标签:运算 异或运算 namespace dad names += include 超时 pac
原文地址:https://www.cnblogs.com/QFNU-ACM/p/12603321.html