hdu 2509 Be the Winner(anti nim)
Be the Winner
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3591 Accepted Submission(s): 2009
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
1
3
Yes
#include <bits/stdc++.h>
using namespace std; int main()
{
int n;
int a;
int i;
int sum, twos;
while (~scanf("%d", &n)) {
sum = , twos = ;
for (i = ; i < n; ++i) {
scanf("%d", &a);
sum ^= a;
if (a >= ) {
++twos;
}
}
if (sum > && twos == || sum == && twos >= ) {//s0, t2
printf("No\n");
} else {
printf("Yes\n");
}
}
return ;
}
hdu 2509 Be the Winner(anti nim)的更多相关文章
- 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 1907 John (anti—Nim)
John Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)http://acm.h ...
- hdu 1907 John(anti nim)
John Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submis ...
- HDU 2509 Be the Winner(取火柴博弈2)
传送门 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int ...
- HDU 5795 A Simple Nim(简单Nim)
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...
- HDU 5783 Divide the Sequence(数列划分)
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...
- HDU 3496 Watch The Movie(看电影)
HDU 3496 Watch The Movie(看电影) Time Limit: 1000MS Memory Limit: 65536K [Description] [题目描述] New sem ...
- HDU 5224 Tom and paper(最小周长)
HDU 5224 Tom and paper(最小周长) Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d &a ...
- HDU 5868 Different Circle Permutation(burnside 引理)
HDU 5868 Different Circle Permutation(burnside 引理) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=586 ...
随机推荐
- python函数回顾:hex()
描述 hex() 函数用于将10进制整数转换成16进制,以字符串形式表示. 语法 hex 语法: hex(x) 参数说明: x -- 10进制整数 返回值 返回16进制数,以字符串形式表示. 实例 & ...
- 如何用jquery获取input输入框中的值?
如何用jquery获取<input id="test" name="test" type="text"/>中输入的值? $(&q ...
- 2、hive的基本操作
1.创建数据库和表 1)创建数据库 hive> CREATE DATABASE IF NOT EXISTS userdb; OK Time taken: 0.252 seconds hive&g ...
- ./bin/console server:run Surprise! There are no commands defined in the "server" namespace.
Let's start the built-in web server: ./bin/console server:run Surprise! There are no commands defi ...
- TCP/IP/UDP 协议
互连网早期的时候,主机间的互连使用的是NCP协议.这种协议本身有很多缺陷,如:不能互连不同的主机,不能互连不同的操作系统,没有纠错功能.为了改善这种缺点,大牛弄出了TCP/IP协议.现在几乎所有的操作 ...
- focus + select
focus使光标定位到目标节点之后 select选中光标所在位置的全部内容
- CSR1010 sdk蓝牙
转:http://blog.csdn.net/lorain_lynies/article/details/52038640CSR1010 I/O开发须知:关于I/O操作的函数库被定义在头文件<p ...
- java经典30笔试题
1. 下面哪些是Thread类的方法() A start() B run() C exit() D getPriority() 答案:ABD 解析:看Java AP ...
- AngularJS 视图和路由
在AngularJS之后引用angular-route 路由 ngRoute模块加载声明 AngularJS提供的when和otherwise两个方法来定义应用的路由 otherwise ...
- Object.defineProperty小解
最早认识这个函数,源于对vue双向绑定的探索,vue通过这个函数实现属性挟持并结合发布者-订阅者模式实现双向绑定 先看一个实例: var o= {name: 'a'} Object.definePro ...