洛谷ios
\(Nim\)遊戲模板題spa
#include<iostream> #include<cstdio> #include<cstdlib> using namespace std; inline int read() { int x=0;bool t=false;char ch=getchar(); while((ch<'0'||ch>'9')&&ch!='-')ch=getchar(); if(ch=='-')t=true,ch=getchar(); while(ch<='9'&&ch>='0')x=x*10+ch-48,ch=getchar(); return t?-x:x; } int main() { int T=read(); while(T--) { int n=read(),s=0; while(n--)s^=read(); puts(s?"Yes":"No"); } return 0; }