POJ 2234 Matches Game(取火柴博弈1)
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std; int main()
{
int n;
while(~scanf("%d",&n))
{
int a,res=0;
for(int i=0;i<n;i++)
{
scanf("%d",&a);
res^=a;
}
if(!res)//T
printf("No\n");
else printf("Yes\n");
}
return 0;
}
POJ 2234 Matches Game(取火柴博弈1)的更多相关文章
- POJ 2234 Matches Game(Nim博弈裸题)
Description Here is a simple game. In this game, there are several piles of matches and two players. ...
- POJ 2234 Matches Game 尼姆博弈
题目大意:尼姆博弈,判断是否先手必胜. 题目思路: 尼姆博弈:有n堆各a[]个物品,两个人轮流从某一堆取任意多的物品,规定每次至少取一个,多者不限,最后取光者得胜. 获胜规则:ans=(a[1]^a[ ...
- POJ 2234 Matches Game (尼姆博弈)
题目链接: https://cn.vjudge.net/problem/POJ-2234 题目描述: Here is a simple game. In this game, there are se ...
- POJ 2234 Matches Game
Matches Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7567 Accepted: 4327 Desc ...
- 题解——POJ 2234 Matches Game
这道题也是一个博弈论 根据一个性质 对于\( Nim \)游戏,即双方可以任取石子的游戏,\( SG(x) = x \) 所以直接读入后异或起来输出就好了 代码 #include <cstdio ...
- HDU 2509 Be the Winner(取火柴博弈2)
传送门 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int ...
- HDU 1907 John(取火柴博弈2)
传送门 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int ...
- 取火柴游戏||Nim博弈
好久之前看的sg函数了 好像就记住一个nim博弈qwq 第一次啊看的时候很迷,现在感觉可以了qwq 首先我们来看一个其他的游戏.(以下游戏只有两个人参与,且足够聪明) 两个人在一张圆形的桌子上放等大的 ...
- poj 1704 Georgia and Bob(阶梯博弈)
Georgia and Bob Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9363 Accepted: 3055 D ...
随机推荐
- >> 计算机的数据表示
1. 采用二进制 2. 负数采用补码表示 3. 乘法处理 4. 浮点数
- springMVC Helloword 入门程序
1 首先是在web.xml 中配置 <servlet> <servlet-name>SpringMVC</servlet-name> <servlet-cl ...
- js学习笔记1
就是调用对象是一个Array,对Array类型增加了一个原型写法的函数,一般写一些扩展时经常用.比如判断一个元素是否在数组中之类的 Array.prototype.inArray=function(v ...
- CODE[VS]-求和-整数处理-天梯青铜
题目描述 Description 求n个数的和 输入描述 Input Description 第一行一个整数n 接下来一行n个整数 输出描述 Output Description 所有数的和 样例输入 ...
- CUDA开发存储器运用(包括存储器之间的转存)
主机端内存(host memory) 主机端叶锁定内存(pinned memory) 显存 寄存器(register) 局部存储器(local memory) 共享存储器(shared memory) ...
- Winform DataGridView直接导出Excel
/// <summary> /// 导出excel /// </summary> /// <param name="fileName">导出文件 ...
- 【AndroidStudio】关于SVN的相关配置简介
AndroidStudio 的SVN 安装和使用方法与我以前用的其他IDE 都有很大差别,感觉特麻烦,网上相关资料很少,貌似现在 Git 比较流行,之前有用过 github 但是他只能是开源项目免费, ...
- 更改系统相机UIImagePickerController导航栏的cancle为自定义按钮
有时候需要对系统相册里面的取消按钮进行自定义,并获取点击事件做一些操作,那么你可以这样做. 第一:实现navigationController代理 - (void)navigationControll ...
- sql第二天
--基本格式 select * from tblclass --对于列进行限制 --格式一:取指定列 select cid,cname from TblClass select cname from ...
- 《JavaScript高级程序设计》读书笔记 ---Function 类型
说起来ECMAScript 中什么最有意思,我想那莫过于函数了——而有意思的根源,则在于函数实际上是对象.每个函数都是Function 类型的实例,而且都与其他引用类型一样具有属性和方法.由于函数是对 ...