hdu 1850 Being a Good Boy in Spring Festival(Nimm Game)

题意:Nimm Game

思路:Nimm Game

#include<iostream>
#include<stdio.h>
using namespace std; int main(){
int m,a[],i,sum,ans;
while(~scanf("%d",&m)&&m){
sum=;
for(i=;i<m;++i){
scanf("%d",&a[i]);
sum^=a[i];
}
if(sum){
ans=;
for(i=;i<m;++i)
if((sum^a[i])<a[i])++ans;//优先级
printf("%d\n",ans);
}
else printf("0\n");
}
return ;
}

另:HDU 1850 Being a Good Boy in Spring Festival(博弈·Nim游戏)

上一篇:Please, another Queries on Array? CodeForces - 1114F (线段树,欧拉函数)


下一篇:HBASE 基础命令总结