code:
//思路是对的,两个数的异或结果是唯一的,但是忽略了,三个数中任意两个数的异或==另一个数
//另外就是一层循环,已知一个数查找另一个数可以用二分,另一个数的个数可以用STL二分获得
//ing
#include <iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int a[1000010];
int main()
{
int n,x;
scanf("%d%d",&n,&x);
for(int i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
sort(a,a+n);
__int64 ans=0;
int l,r;
for(int i=0;i<n;i++)
{
l=lower_bound(a+i+1,a+n,a[i]^x)-a;
r=upper_bound(a+i+1,a+n,a[i]^x)-a;
ans+=r-l;
}
printf("%I64d\n",ans);
return 0;
}