poj2234--Matches Game
题目大意:n堆石子,可以任取一堆任意个数,不能不取,求先手是否必胜。
裸Nim
1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<cmath> 5 #include<string> 6 #include<algorithm> 7 int n; 8 int main(){ 9 while (~scanf("%d",&n)){ 10 int s=0,x=0; 11 for (int i=1;i<=n;i++){ 12 scanf("%d",&x); 13 s^=x; 14 } 15 if (s>0) printf("Yes\n"); 16 else printf("No\n"); 17 } 18 }