HDU 5591 ZYB's Game(博弈水题)
来源:互联网 发布:ios vip解析软件 编辑:程序博客网 时间:2024/06/15 20:33
ZYB’s Game
Time Limit: 1000msMemory Limit: 65536KB 64-bit integer IO format: %I64d Java class name: Main
Submit Status
ZYB played a game named NumberBomb with his classmates in hiking:a host keeps a number in [1,N] in mind,then
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].
Input
In the first line there is the number of testcases T.
For each teatcase:
the first line there is one number N.
1≤T≤100000,1≤N≤10000000
Output
For each testcase,print the ans.
Sample Input
1
3
Sample Output
1
#include <bits/stdc++.h>using namespace std;int main(){ int t; scanf("%d",&t); for(int i=1;i<=t;i++) { int x; scanf("%d",&x); printf("%d\n",x&1); }}
- HDU 5591 ZYB's Game(博弈水题)
- HDU 5591 ZYB's Game(博弈)
- hdu 5591 ZYB's Game(水)
- HDU 5591 ZYB's Game
- HDU 5591 ZYB's Game
- HDOJ 5591 ZYB's Game(简单博弈)
- 【博弈】HDOJ ZYB's Game 5591
- HDOJ 5591 ZYB's Game 【简单博弈 】
- HDU5591 - ZYB's Game (简单博弈)
- HDU 5591 ZYB's Game(取石子)
- HDOJ 5591 ZYB's Game
- hdoj-5591-ZYB's Game
- hdu 5590 ZYB's Biology(水)
- hdoj ZYB's Game 5901 (数学规律题)
- HDU 1525 Euclid's Game (博弈)
- hdu 2147 kiki's game (博弈)
- HDU 1525 Eculid's Game(博弈)
- HDU 1525 Euclid's Game(博弈)
- java中文乱码解决之道(九)—–总结
- 【css】CSS实现div的全屏自适应显示
- java SSH三大框架整合,实现了泛型baseAction,泛型baseService,泛型baseDao
- 我理解的MVC设计模式和三层架构
- FFmpeg - C++中使用ffmpeg库
- HDU 5591 ZYB's Game(博弈水题)
- Android中的SharedPreferences存储数据方式
- 《JAVA与模式》之简单工厂模式
- Codeforces Round #340 (Div. 2) by komendart
- java高级特性
- 设计模式之:调停者模式
- 使用WebRTC搭建前端视频聊天室——入门篇
- tortoisesvn的使用
- 5-10 UVA 1597 Searching the Web在Web中搜索