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. UITableView---iOS-Apple苹果官方文档翻译

    本系列所有开发文档翻译链接地址:iOS7开发-Apple苹果iPhone开发Xcode官方文档翻译PDF下载地址  //转载请注明出处--本文永久链接:http://www.cnblogs.com/C ...

  2. SCU 1029 Humble Numbers (打表处理)

    题目链接 题意:素因子中只有2 3 5 7的数称为谦逊的数,1也是谦逊的数,题目中已经给出了前20个谦逊的数.给定数字n,按格式输出第n个谦逊的数. 题解:打表即可,注意打表的技巧就行了. ps:这道 ...

  3. elementui input样式覆盖 头部小图等

    .nav-right >>> .keywords .el-input__inner { -webkit-appearance: none; background-color: #F3 ...

  4. 阅读关于DuReader:百度大规模的中文机器阅读理解数据集

    很久之前就得到了百度机器阅读理解关于数据集的这篇文章,今天才进行总结!.... 论文地址:https://arxiv.org/abs/1711.05073 自然语言处理是人工智能皇冠上的明珠,而机器阅 ...

  5. mysql连接池优化笔记

    中间件mycat是一个高性能的分表分库读写分离的中间件,但配置不好的情况会出现很多性能问题. 1.mycat-web的监控的准确性有问题,1.6-RELEASE  ,1.0-SNAPSHOT (web ...

  6. Deep Learning基础--26种神经网络激活函数可视化

    在神经网络中,激活函数决定来自给定输入集的节点的输出,其中非线性激活函数允许网络复制复杂的非线性行为.正如绝大多数神经网络借助某种形式的梯度下降进行优化,激活函数需要是可微分(或者至少是几乎完全可微分 ...

  7. c json实战引擎四 , 最后❤跳跃

    引言  - 以前那些系列 长活短说, 写的最终 scjson 纯c跨平台引擎, 希望在合适场景中替代老的csjon引擎, 速度更快, 更轻巧. 下面也是算一个系列吧. 从cjson 中得到灵感, 外加 ...

  8. SVN服务的配置与管理

    引言 没当服务器重启,SVN服务都会停止,每次都得重启一下服务,为了解决这样的问题.有了下文. 一.配置自启动服务 sc create SVNService binpath="E:\svn\ ...

  9. jquery - 实例1

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="text2.aspx.cs& ...

  10. CF633F The Chocolate Spree

    Description Alice and Bob have a tree (undirected acyclic connected graph). There are \(a_{i}\) choc ...