A
#include<iostream>
using namespace std;
int main()
{
int n;
scanf("%d",&n);
if(n==0) printf("1\n");
else{
int m=n%4;
if(m==1) printf("8\n");
else if(m==2) printf("4\n");
else if(m==3) printf("2\n");
else printf("6\n");
}
return 0;
}
B
#include<iostream>
using namespace std;
const int maxn=1e6+5;
typedef long long LL;
LL a[maxn],f[maxn];
int main()
{
LL n,x;
cin>>n>>x;
LL res=0;
for(int i=0;i<n;i++){
cin>>a[i];
res+=f[(a[i]^x)];
f[a[i]]++;
}
cout<<res<<endl;
return 0;
}