BestCoder Round #65 hdu5591(尼姆博弈)
ZYB's Game
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 527 Accepted Submission(s): 430
players guess a number in turns,the player who exactly guesses X loses,or the host will tell all the players that
the number now is bigger or smaller than X.After that,the range players can guess will decrease.The range is [1,N] at first,each player should guess in the legal range.
Now if only two players are play the game,and both of two players know the X,if two persons all use the best strategy,and the first player guesses first.You are asked to find the number of X that the second player
will win when X is in [1,N].
For each teatcase:
the first line there is one number N.
1≤T≤100000,1≤N≤10000000
#include<stdio.h>
#include<string.h>
#include<string>
#include<math.h>
#include<algorithm>
#define LL long long
#define PI atan(1.0)*4
#define DD double
#define MAX 110
#define mod 10007
#define dian 1.000000011
using namespace std;
int main()
{
int t,n,m,i,j;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
if(n%2==0)
printf("0\n");
else
printf("1\n");
}
return 0;
}
BestCoder Round #65 hdu5591(尼姆博弈)的更多相关文章
- 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 ...
- Bestcoder round #65 && hdu 5593 ZYB's Tree 树形dp
Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submissio ...
- Bestcoder round #65 && hdu 5592 ZYB's Premutation 线段树
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submissio ...
- HDU 4315 Climbing the Hill (阶梯博弈转尼姆博弈)
Climbing the Hill Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Su ...
- Light OJ 1393 Crazy Calendar (尼姆博弈)
C - Crazy Calendar Time Limit:4000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Su ...
- LightOJ 1247 Matrix Game (尼姆博弈)
A - Matrix Game Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submi ...
- Light OJ 1253 Misere Nim (尼姆博弈(2))
LightOJ1253 :Misere Nim 时间限制:1000MS 内存限制:32768KByte 64位IO格式:%lld & %llu 描述 Alice and Bob ar ...
随机推荐
- [POJ2828]Buy Tickets(线段树,单点更新,二分,逆序)
题目链接:http://poj.org/problem?id=2828 由于最后一个人的位置一定是不会变的,所以我们倒着做,先插入最后一个人. 我们每次处理的时候,由于已经知道了这个人的位置k,这个位 ...
- Sublime Text汉化方法和注册码
汉化方法 安装 SublimeText3 汉化包运行SublimeText3 点击 Preferneces -> Browse Packages 会打开 X:\..\Sublime Text 3 ...
- Android之界面刷新(invalidate和postInvalidate使用)
Android中实现view的更新有两组方法,一组是invalidate,另一组是postInvalidate,其中前者是在UI线程自身中使用,而后者在非UI线程中使用. Android提供了Inva ...
- UVa 11181 (条件概率) Probability|Given
题意: 有n个人买东西,第i个人买东西的概率为Pi.已知最终有r个人买了东西,求每个人买东西的概率. 分析: 设事件E为r个人买了东西,事件Ei为第i个人买了东西.所求为P(Ei|E) = P(EiE ...
- 淘宝技术发展(Java时代:脱胎换骨)
我的师父黄裳@岳旭强曾经说过,“好的架构图充满美感”,一个架构好不好,从审美的角度就能看得出来.后来我看了很多系统的架构,发现这个言论基本成立.那么反观淘宝前面的两个版本的架构,你看哪个比较美? 显然 ...
- 待实践三:MVC3下 路由的测试 使用 RouteDebug.dll 来测试判断路由是否符合
在需要进行测试路由是否匹配的项目中引用 RouteDebug.dll 并且在MVC的Global.asax里面加入一段代码 //下面这行代码一定是在 RegisterRoutes(Rou ...
- android下ListView的奇异异常大集合(持续更新)
使用ListView的addFooterView或者addHeaderView报错或者不知名的异常:at android.widget.ListView.clearRecycledState(List ...
- Mac下配置PHP+Apache+phpMyAdmin+MySql远程链接
最近的项目是微信公众号平台的开发,微信官方给出的Demo是PHP的,发现大部分的学习资料也是PHP,那好吧,放弃Java,来段儿PHP吧 下面说说Mac下搭建PHP环境 数据库:MySQL-5.6.2 ...
- 【策略】HDOJ-1205-吃糖果
[题目链接:HDOJ-1205] 思路:直接看题毫无思路... 看了别人的思路,到现在还懵懵懂懂. 只要除了数目最多的糖果以外的其他所有糖果的数目之和加1(小心这里要用int64),大于等于数目最 ...
- 关于DatePicker控件在IsEnabled为False视觉效果没有明显辨识度的处理方法
DatePicker控件在IsEnabled为False时界面没有让人看上去不可用(背景为灰色等)的效果.容易让用户迷惑. 可以用下面的代码增加设置透明度的触发器来解决(XAML以及C#方式): &l ...