hdoj--2509--Be the Winner(尼姆博弈)
Be the Winner
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2718 Accepted Submission(s): 1487
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).
2
2 2
1
3
No
Yes#include <stdio.h>
#include <string.h>
using namespace std;
#define M 50
int num[M];
int main()
{
int i,ans,re,n;
while(scanf("%d",&n)!=EOF)
{
ans=0,re=0;
for(i=0;i<n;i++)
{
scanf("%d",&num[i]);
if(num[i]>1)
ans++;
re^=num[i];
}
if(ans)
{
if(re)
printf("Yes\n");
else
printf("No\n");
}
else
{
if(re)
printf("No\n");
else
printf("Yes\n");
}
}
return 0;
}
hdoj--2509--Be the Winner(尼姆博弈)的更多相关文章
- hdu-------(1848)Fibonacci again and again(sg函数版的尼姆博弈)
Fibonacci again and again Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Jav ...
- hdu 1907 (尼姆博弈)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1907 Problem Description Little John is playing very ...
- POJ 2234 Matches Game (尼姆博弈)
题目链接: https://cn.vjudge.net/problem/POJ-2234 题目描述: Here is a simple game. In this game, there are se ...
- HDU1907(尼姆博弈)
John Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submis ...
- POJ 3480 & HDU 1907 John(尼姆博弈变形)
题目链接: PKU:http://poj.org/problem? id=3480 HDU:http://acm.hdu.edu.cn/showproblem.php? pid=1907 Descri ...
- hdu 1907 尼姆博弈
John Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submis ...
- hdu----(1849)Rabbit and Grass(简单的尼姆博弈)
Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- hdu 1849(Rabbit and Grass) 尼姆博弈
Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- Being a Good Boy in Spring Festival 尼姆博弈
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Descr ...
- HDU 4315 Climbing the Hill (阶梯博弈转尼姆博弈)
Climbing the Hill Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Su ...
随机推荐
- 解决emlog默认导航不能修改的问题以及修改后台登录地址的方法
修改默认导航 我们需要使用修改代码的方式来解决 首先找到admin/navbar.php文件 然后找到需要删除的几行代码: if ($type != Navi_Model::navitype_cust ...
- Maven项目pom.xml配置详解
maven项目pom.xml文件配置详解,需要时可以用作参考: <project xmlns="http://maven.apache.org/POM/4.0.0" xmln ...
- mysql Workbench新建数据库连接时提示SSl not enabled的问题
在使用workbench时会弹出以下的对话框,不过这不影响使用,点击ok之后对话框关闭,接着直接点击close就行了,之后会显示已经连接上了数据库.具体ssl的方面还没研究,等研究了再贴
- opengl使用FreeType绘制字体
原文地址:http://www.cnblogs.com/zhanglitong/p/3206497.html
- MYSQL 代码删除和添加表格列方法
一个表格建立后用代码删除或添加列: -- 删除列alter table teacher drop column create_time;-- 添加列alter table teacher add co ...
- 编译带加密功能的sqlite
以为编译wxsqlite是很难的事情,竟然这么顺利. 1.下载wxsqlite代码,解压(wxcode.sourceforge.net/components/wxsqlite3/) 2.下载Prema ...
- Java_Web之俱乐部会员信息管理系统
使用 Jsp实现俱乐部会员信息管理功能,orac1e11g作为后台数据库,该系统包括查看俱乐部会员信息列表和修改俱乐部会员信息两人功能,具体耍求如下: 打开俱乐部会员信息列表页面,以列表方式显示所有俱 ...
- java 基础回顾1
整理----加自己理解------网上参考----- java封装理念 一 概念: 隐藏对象的属性和实现细节,仅供对外提供公共访问方式. 二 好处 1) 将变量隔离 2) 便于使用 3) 提高重 ...
- Java继承实现接口的抽象类
1.TestIntace.java package com.chase.abstrac; /** * 接口 * @author Chase * * @date 2013-10-21 下午02:29:1 ...
- 【第二课】kaggle案例分析二
Evernote Export 推荐系统比赛(常见比赛) 推荐系统分类 最能变现的机器学习应用 基于应用领域分类:电子商务推荐,社交好友推荐,搜索引擎推荐,信息内容推荐等 **基于设计思想:**基于协 ...