传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1850
题目大意:中文题目不解释
分析:
裸的NIM就是加个分析必胜策略的个数。
代码
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int a[1000005];
int main()
{
int i,m,ans;
while(~scanf("%d",&m) && m)
{
for(ans=i=0;i<m;i++)
{
scanf("%d",a+i);
ans ^= a[i];
}
if(!ans)
printf("0\n");
else
{
int total = 0;
for(i=0;i<m;i++)
{
if(a[i] >= (ans^a[i]))
total++;
}
printf("%d\n",total);
}
}
return 0;
}