Problem Description
played a game named
with his classmates in hiking:a host keeps a number in
in mind,then players guess a number in turns,the player who exactly guesses
loses,or the host will tell all the players that the number now is bigger or smaller than
.After that,the range players can guess will decrease.The range is
Now if only two players are play the game,and both of two players know the ,if two persons all use the best strategy,and the first player guesses first.You are asked to find the number of
that the second player will win when
is in
.
Input
In the first line there is the number of testcases .
For each teatcase:
the first line there is one number .
,
Output
For each testcase,print the ans.
Sample Input
1 3
Sample Output
1
简单题,直接推导一下就好
#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long LL;
const int maxn = 1e7 + 5;
int T, n, m;
int main()
{
scanf("%d", &T);
while (T--)
{
scanf("%d", &n);
printf("%d\n", n & 1);
}
return 0;
}