Be the Winner
来源:互联网 发布:和孩子一起学编程 官网 编辑:程序博客网 时间:2024/05/17 22:55
博弈题如果知道其中的原理,结论很容ac
#include"stdio.h"
#include"string.h"
int a[60000];
int main()
{
int num1,num2,m,ans,i;
while(scanf("%d",&m)!=EOF)
{
num1=0;//计算充裕堆数《大于1》
num2=0;//计算孤单堆。(等于1)
ans=0;//异或用来判断是否是奇异局势
for(i=0;i<m;i++)
{
scanf("%d",&a[i]);
if(a[i]>=2)
num1++;
else
num2++;
ans=ans^a[i];
}
if(ans==0&&num1==0||ans!=0&&num1!=0)
printf("Yes\n");
else
printf("No\n");
}
return 0;
}
- hdu2509 Be the Winner
- Be the Winner
- HDJOJ--be the winner
- Be the Winner
- HDU2509 Be the Winner 博弈
- hdu 2509 Be the Winner
- HDU 2509 Be The Winner
- HDU2509:Be the Winner(Nim)
- hdu-2509 Be the Winner
- hdu 2509 Be the Winner
- HDU 2509 Be the Winner
- HDU 2509 Be the Winner
- HDU 2509 Be the Winner
- HDU 2509 Be the Winner
- hdu 2509 Be the Winner
- hdu 2509 Be the Winner
- HDU 2509 Be The Winner ( Nim 博弈 )
- hdu 2509 Be the Winner 1907 John
- Tutorial 17 - Ambient Lighting
- QT 中几种数据格式的转换(从qtcn大神那里采集的,感谢那位大神)
- Redhat Linux 6 下实现ISCSI
- OCP-1Z0-053-V12.02-367题
- UVa 10057 A mid-summer night's dream. (二分&可以取哪些作为中位数?)
- Be the Winner
- 项目管理工程师对项目团队的责任
- nyojSticks
- 使table中的td可编辑
- 链表判断是否有环的方法分析及论证
- A* 搜索算法
- 使用Visual Leak Detector检测内存泄漏
- android表示单位长度的三种方式
- akka环境配置