#include<bits/stdc++.h>
using namespace std;
int main(){
int n,i,j,nn,a[500000],sum,k=0,p,max,ans[20],num=1;
cin>>n;
for(i=1;i<=n;i++){
max=0;
cin>>nn;
for(j=1;j<=nn;j++){
cin>>p;
sum=1;
while(p>0){
a[sum]+=p%2;
p=p/2;
sum++;
}
if(sum>max)max=sum-1;
}
for(j=1;j<=sum;j++){
if(a[j]%2!=0)k=1;
}
if(k!=1)ans[num]=0;
else ans[num]=1;
num++;
memset(a,0,sizeof(a));
}
for(i=1;i<=n;i++){
if(ans[i]==0)cout<<"No"<<endl;
else cout<<"Yes"<<endl;
}
return 0;
}
然后。。。全部WA
(语言C++