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. windows 常用dos命令

    explorer目录 打开当前目录 explorer . 打开上级目录 explorer .. 打开任意目录 explorer dirname cls 命令 清屏屏幕,屏幕显示的所有字符信息都是存放在 ...

  2. python,判断操作系统是windows,linux

    import sys,platform print(sys.platform) print(platform.system()) sys.platform: 获取当前系统平台. platform.sy ...

  3. 《Python》进程之间的通信(IPC)、进程之间的数据共享、进程池

    一.进程间通信---队列和管道(multiprocess.Queue.multiprocess.Pipe) 进程间通信:IPC(inter-Process Communication) 1.队列 概念 ...

  4. 《Python》常用内置模块

    一.time模块(时间模块) 三种格式: 1.时间戳时间(timestamp):浮点数,秒为单位,从1970年1月1日0时距今的时间 1970.1.1  0:0:0 英国伦敦时间(开始时间) 1970 ...

  5. Excel 数据读入到DataSet

    using System; using System.Collections.Generic; using System.Linq; using System.Data; using System.I ...

  6. python中处理.db文件借助navicat

    navicat premium 12  中可以点击“连接” --sqllite 然后选择.db等文件导入 即可再导成..csv等格式.

  7. Android开发---基本UI组件1:自动拨电话,自动上网,输入框不换行、只输数字、只输文本、只输密码

    1.activity_main.xml 描述:构建一个按钮 <?xml version="1.0" encoding="utf-8"?> <L ...

  8. Linux文件系统命令 mv

    命令名:mv 功能:移动一个文件,从一个位置到另外一个位置. 用法:mv source_dir dist_dir eg: renjg@renjg-HP-Compaq-Pro--MT:/var/tmp$ ...

  9. shell日常实战防dos攻击

    根据web日志或者或者网络连接数,监控当某个IP并发连接数或者短时内PV达到100,即调用防火墙命令封掉对应的IP,监控频率每隔3分钟.防火墙命令为:iptables -I INPUT -s 10.0 ...

  10. django本身提供了runserver,为什么不能用来部署(runserver与uWSGI的区别)

    runserver方法是调试django时经常用到的运行方式,它使用django自带的. WSGI Server 运行,主要在测试和开发使用,并且runserver 开启的方式也是单线程. uWSGI ...