推荐阅读:
\(nim\)
\(SG\)
\(OI-wiki\) 公平组合游戏
点击查看代码
#include<bits/stdc++.h>
#define cs const
#define ri register
using namespace std;typedef int I;const I inf=0x3f3f3f3f;typedef long long LL;I FL,CH;template<typename T>bool in(T&a){for(FL=1;!isdigit(CH)&&CH!=EOF;CH=getchar())if(CH=='-')FL=-1;for(a=0;isdigit(CH);CH=getchar())a=a*10+CH-'0';return a*=FL,CH==EOF?0:1;}template<typename T,typename...Args>I in(T&a,Args&...args){return in(a)+in(args...);}
cs int N=1e4+7;
int T,a[N],ans,n;
int main()
{
in(T);
while(T--)
{
in(n),ans=0;//init
for(ri int i=1;i<=n;++i)
in(a[i]),ans^=a[i];
puts(ans?"Yes":"No");
}
return 0;
}