ZYB's Game

Accepts: 672
Submissions: 1207
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/65536 K (Java/Others)
Problem Description

ZYBZYBZYB played a game named NumberBombNumber BombNumberBomb with his classmates in hiking:a host keeps a number in [1,N][1,N][1,N] in mind,then players guess a number in turns,the player who exactly guesses XXX loses,or the host will tell all the players that the number now is bigger or smaller than XXX.After that,the range players can guess will decrease.The range is [1,N][1,N][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 XXX,if two persons all use the best strategy,and the first player guesses first.You are asked to find the number of XXX that the second player will win when XXX is in [1,N][1,N][1,N].

Input

In the first line there is the number of testcases TTT.

For each teatcase:

the first line there is one number NNN.

1≤T≤1000001 \leq T \leq 1000001≤T≤100000,1≤N≤100000001 \leq N \leq 100000001≤N≤10000000

Output

For each testcase,print the ans.

Sample Input
1
3
Sample Output
1
心得:总共才两个人,而且都知道X是多少(出题人在想什么?)先选的人先赢啊;
#include <iostream>
using namespace std;
int t,n;
int main(){
cin>>t;
for(int i=;i<t;i++){
cin>>n;
     cout<<n%<<endl;
}
return ;
}

BestCoder Round #65 (ZYB's Game)的更多相关文章

  1. BestCoder Round #65 (ZYB's Premutation)

    ZYB's Premutation Accepts: 220 Submissions: 983 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: ...

  2. BestCoder Round #65 (ZYB's Biology)

    ZYB's Biology Accepts: 848 Submissions: 1199 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 13 ...

  3. hdu 5592 BestCoder Round #65(树状数组)

    题意: ZYB有一个排列PP,但他只记得PP中每个前缀区间的逆序对数,现在他要求你还原这个排列. (i,j)(i < j)(i,j)(i<j)被称为一对逆序对当且仅当A_i>A_jA ...

  4. hdu 5591 BestCoder Round #65(博弈)

    题意: 问题描述 ZYBZYB在远足中,和同学们玩了一个“数字炸弹”游戏:由主持人心里想一个在[1,N][1,N]中的数字XX,然后玩家们轮流猜一个数字,如果一个玩家恰好猜中XX则算负,否则主持人将告 ...

  5. BestCoder Round #85(ZOJ1569尚未验证)

    A题 子序列和啊,就要想到前缀和的差.这个转换一定要!记着!那么i到j的一段子序列和Sij%m ==  0就等价于(Sj-Si-1)%m == 0 了,那么什么意思呢?就是如果有两段前缀和%m的模是一 ...

  6. BestCoder Round #65 HDOJ5592 ZYB&#39;s Premutation(树状数组+二分)

    ZYB's Premutation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Othe ...

  7. 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 ...

  8. Bestcoder round #65 && hdu 5592 ZYB's Premutation 线段树

    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submissio ...

  9. hdu 4956 Poor Hanamichi BestCoder Round #5(数学题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4956 Poor Hanamichi Time Limit: 2000/1000 MS (Java/Ot ...

随机推荐

  1. Ubuntu 15.04 编译UE4 for Linux版

    源 起 Unreal Engine 4 是全球最先进的Realtime Illumination & Physical 引擎: 长期以来,UE4都只有Windows版和Mac版,今年终于向Li ...

  2. 「6月雅礼集训 2017 Day7」回转寿司

    [题目大意] 给一个n个数的序列,q次操作,每次选择区间$[l,r]$,给出数p,对于区间$[l,r]$的每个数$x$,做如下操作: 如果$x > p$,就交换$x$和$p$.求每次操作后$p$ ...

  3. 【51NOD-0】1008 N的阶乘 mod P

    [算法]简单数学 [题解]多项式展开:(a*b)%p=(a%p*b%p)%p #include<cstdio> #include<algorithm> #define rep( ...

  4. C#编写程序监测某个文件夹内是否有文件进行了增,删,改的动作?

    新建一个Console应用程序,项目名称为“FileSystemWatcher”,Copy代码进,编译后就可以用了.代码如下: using System; using System.Collectio ...

  5. 如何创建和销毁对象(Effective Java 第二章)

    最近有在看Effective Java,特此记录下自己所体会到的东西,写篇博文会更加的加深印象,如有理解有误的地方,希望不吝赐教. 这章主题主要是介绍:何时以及如何创建对象,何时以及如何避免创建对象, ...

  6. 【Python学习】解决pandas中打印DataFrame行列显示不全的问题

    在使用pandas的DataFrame打印时,如果表太长或者太宽会自动只给前后一些行列,但有时候因为一些需要,可能想看到所有的行列. 所以只需要加一下的代码就行了. #显示所有列 pd.set_opt ...

  7. C++之复制控制

    只有单个形参,而且该形参是对本类类型对象的引用(常用const修饰),这样的构造函数叫做复制构造函数(有时也称为拷贝构造函数),例如: class Person{ public: Person();/ ...

  8. handle_level_irq 与handle_edge_irq 的区别【转】

    转自:http://blog.csdn.net/xavierxiao/article/details/6087277 版权声明:本文为博主原创文章,未经博主允许不得转载. Linux 里, handl ...

  9. tornado当用户输入的URL无效时转入设定的页面

    今天做web的测验..坑爹的要用tornado...作为一个比较新的用的人还不多的东东...查资料好麻烦.. 下面是当用户输入非法 url时, 显示一个自定义 404 页面提示用户,其访问的页面不存在 ...

  10. 【bzoj4486】【JSOI2015】串分割

    老省选题了. 首先考虑怎么比较超长数字的大小? 参见UTR1的那道题 先比size,然后比较字典序即可. 接下来考虑下切割的问题. 因为要将字符串切割成k份,所以这个字符串只会存在n/k个本质不同的起 ...