hdu 2509 博弈 *
多堆的情况要处理好孤单堆
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
using namespace std;
#define MOD 1000000007
const int INF=0x3f3f3f3f;
const double eps=1e-;
typedef long long ll;
#define cl(a) memset(a,0,sizeof(a))
#define ts printf("*****\n");
const int MAXN=;
int n,m,tt;
int main()
{
int i,j,k,ca=;
#ifndef ONLINE_JUDGE
freopen("1.in","r",stdin);
#endif
while(scanf("%d",&n)!=EOF)
{
int temp=;
int a;
int ans;
for(i=;i<n;i++)
{
scanf("%d",&a);
if(i==)
{
ans=a;
}
else ans^=a;
}
if(ans==)
printf("No\n");
else
printf("Yes\n");
}
}
hdu 2509 博弈 *的更多相关文章
- HDU 2509 Nim博弈变形
1.HDU 2509 2.题意:n堆苹果,两个人轮流,每次从一堆中取连续的多个,至少取一个,最后取光者败. 3.总结:Nim博弈的变形,还是不知道怎么分析,,,,看了大牛的博客. 传送门 首先给出结 ...
- HDU 2509 基础Anti-SG NIM
如果我们规定当局面中所有的单一游戏的SG值为0时,游戏结束,则先手必胜当且仅当:(1)游戏的SG!=0 && 存在单一游戏的SG>1:(2)游戏的SG==0 && ...
- S-Nim HDU 1536 博弈 sg函数
S-Nim HDU 1536 博弈 sg函数 题意 首先输入K,表示一个集合的大小,之后输入集合,表示对于这对石子只能去这个集合中的元素的个数,之后输入 一个m表示接下来对于这个集合要进行m次询问,之 ...
- hdu 1907 John&& hdu 2509 Be the Winner(基础nim博弈)
Problem Description Little John is playing very funny game with his younger brother. There is one bi ...
- HDU 2509 Be the Winner nim博弈变形
Be the Winner Problem Description Let's consider m apples divided into n groups. Each group contai ...
- HDU 2509 nim博弈
Be the Winner Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot ...
- hdu 2509 Be the Winner 博弈
题目链接 有n堆苹果, 对于其中的每一堆的x个苹果, 它是放在一条线上的. 你每次可以对一堆苹果进行操作, 可以取y个, 1<=y<=x. 然后如果你是取的一条线上中间的苹果, 那么这一堆 ...
- (step8.2.2)hdu 2509(Be the Winner——简单博弈)
题目大意:输入一个整数n,表示火柴堆数(原题其实指的是苹果堆数,但是为了尽量与模板保持一致,所以在这里理解为火柴堆数....其实理解为什么都没关系, 重要的是,理解就行....).在接下来的一行中,有 ...
- HDU 2509 Be the Winner(取火柴博弈2)
传送门 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int ...
随机推荐
- eos超时 锁表问题 网友办法
select * from v$locked_object; SELECT sid, serial#, username, osuser FROM v$session where sid = 45; ...
- [20160731]read a file and print it on the screen
//read a file and print it on the screen import java.io.*; public class MyPrintStreamTest2{ public s ...
- SQLServer:FUNCTION/CURSOR/PROCEDURE/TRIGGER
一.FUNCTION:在sqlserver2008中有3中自定义函数:标量函数/内联表值函数/多语句表值函数,首先总结下他们语法的异同点:同点:1.创建定义是一样的: ...
- MDI窗体
1.设置父窗体 使用MDI窗体,需要先将父窗体的IsMdiContainer属性设置为True 2.生成用于MDI子窗体的窗体 1 frmTemp f1 = new frmTemp(); f1.Tex ...
- 76 binary_search 查找重复元素
[本文链接] http://www.cnblogs.com/hellogiser/p/binary-search-for-repeated-element.html [题目] 给定一个升序排列的自然数 ...
- spring3 的restful API RequestMapping介绍
原文链接:http://www.javaarch.net/jiagoushi/694.htm spring3 的restful API RequestMapping介绍 在spring mvc中 @R ...
- WPF页面 全球化和本地化
传统的 新建.resx类型的文件中,然后利用ResourceManager来得到相应资源并根据当地的CultureInfo来给界面文本赋值. WPF 新建一个文件夹 Language 新建2个资源字典 ...
- shell 监控局域网的主机是否up
#!/bin/bash ;i<;i++)) ;do .$i>/dev/null #ping -c 172.31.0.30 ~172.31.0.59 ]] #if up $?==0 then ...
- ffmpeg-20160728-bin.7z
ESC 退出 0 进度条开关 1 屏幕原始大小 2 屏幕1/2大小 3 屏幕1/3大小 4 屏幕1/4大小 S 下一帧 [ -2秒 ] +2秒 ; -1秒 ' +1秒 下一个帧 -> -5秒 f ...
- c/c++与Python的语法差异
1.程序块语法方面: c/c++中用一对“{}”将多段语句括起来,表示一个程序块,并以右大括号表明程序块结束 ;i<n;i++) { cout<<a[i]; j+=; } Pytho ...