Let's consider m apples divided into n groups. Each group contains no more than 100 apples, arranged in a line. You can take any number of consecutive apples at one time.
For example "@@@" can be turned into "@@" or "@" or "@ @"(two piles). two people get apples one after another and the one who takes the last is 
the loser. Fra wants to know in which situations he can win by playing strategies (that is, no matter what action the rival takes, fra will win).

博弈

 #include<stdio.h>

 int main(){
int n;
while(scanf("%d",&n)!=EOF){
int i,sum=,num=;
for(i=;i<=n;i++){
int a;
scanf("%d",&a);
if(a>)num++;
sum^=a;
}
if((num==&&sum==)||(sum>&&num>))printf("Yes\n");
else printf("No\n");
}
return ;
}

hdu2509 Be the Winner 博弈的更多相关文章

  1. HDU2509 Be the Winner

    Be the Winner Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tot ...

  2. HDU-2509 Be the Winner

    http://acm.hdu.edu.cn/showproblem.php?pid=2509 Be the Winner Time Limit: 2000/1000 MS (Java/Others)  ...

  3. HDU-2509-Be the Winner,博弈题~~水过~~

    Be the Winner Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ht ...

  4. hdu 2509 Be the Winner 博弈

    题目链接 有n堆苹果, 对于其中的每一堆的x个苹果, 它是放在一条线上的. 你每次可以对一堆苹果进行操作, 可以取y个, 1<=y<=x. 然后如果你是取的一条线上中间的苹果, 那么这一堆 ...

  5. anti-nim 游戏

    游戏描述: 桌上有n堆石子,游戏双方轮流取石子,每次只能从一堆中取出任意数目的石子,不能不取,取走最后一个石子者失败. 结论: 先手必胜,当且仅当: ①.所有堆的石子数都为1,且游戏的SG值为0. ② ...

  6. HDU 5754 Life Winner Bo 组合博弈

    Life Winner Bo Problem Description   Bo is a "Life Winner".He likes playing chessboard gam ...

  7. 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 ...

  8. hdu2509Be the Winner(反nim博弈)

    Be the Winner Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tot ...

  9. hdu-5754 Life Winner Bo(博弈)

    题目链接: Life Winner Bo Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 131072/131072 K (Java/ ...

随机推荐

  1. Serial interface (RS-232)

    转自:http://www.fpga4fun.com/SerialInterface.html A serial interface is a simple way to connect an FPG ...

  2. String转换成Boolean类型

    Boolean.valueOf()方法: public static Boolean valueOf(String s) { return toBoolean(s) ? TRUE : FALSE; } ...

  3. 为什么不同网段的ip 不能直接通信

    首先要明白一点,IOS一共七层, 发送数据的过程是从上到下,也就是从应用层一直到物理层,接受数据是从下至上. 来看你的问题,环境如下,我们来用一个ping命令的过程来解释:一个交换机,连两个电脑A和B ...

  4. pssac plot

    for multi-waveforms with different colors: R-Xmin/-Xmax/Ymin/Ymax -Ba/b, a: x delta; b:y delta -MYma ...

  5. python中的运算符归类

    运算符 目标 算数运算符 比较(关系)运算符 逻辑运算符 赋值运算符 成员运算符 运算符的优先级 数学符号表链接:https://zh.wikipedia.org/wiki/数学符号表 01. 算数运 ...

  6. 百度地图API示例:鼠标绘制点线面 控件修改

    需求 :在使用地图API时,绘制工具栏控件想自己选择哪些要,哪些不要. 可以查看相应的类:官网地址: http://api.map.baidu.com/library/DrawingManager/1 ...

  7. mysql 转义字符问题

    首先我们要知道,数据库都是由表构成的,当你把数据插入到其中的一个表中的时候,比如是数字呀.文字呀等等的插入的时候能正常插入,但是一旦你要插入特殊的字符,比如说插入下面这个括号里面的内容(“ABC”)到 ...

  8. mysql创建用户并授予权限

    MySQL创建数据库与创建用户以及授权   1.create schema [数据库名称] default character set utf8 collate utf8_general_ci;--创 ...

  9. Python中常见字符串去除空格的方法总结

    Python中常见字符串去除空格的方法总结 1:strip()方法,去除字符串开头或者结尾的空格>>> a = " a b c ">>> a.s ...

  10. Java Editplus编译环境配置

    java jdk 安装win10 配置:此电脑--属性--高级系统设置--环境变量--系统变量-->新建--变量名--JAVA_HOME 变量值--浏览目录--jdk安装路径jdk...--&g ...