首页 > 其他分享 >HDU 5591 ZYB's Game

HDU 5591 ZYB's Game

时间:2022-11-09 19:01:40浏览次数:52  
标签:5591 HDU ZYB player int number two players first


Problem Description



HDU 5591	 ZYB played a game named HDU 5591	 ZYB with his classmates in hiking:a host keeps a number in HDU 5591	 ZYB in mind,then players guess a number in turns,the player who exactly guesses HDU 5591	 ZYB loses,or the host will tell all the players that the number now is bigger or smaller than HDU 5591	 ZYB.After that,the range players can guess will decrease.The range is HDU 5591	 ZYB

Now if only two players are play the game,and both of two players know the HDU 5591	 ZYB,if two persons all use the best strategy,and the first player guesses first.You are asked to find the number of HDU 5591	 ZYB that the second player will win when HDU 5591	 ZYB is in HDU 5591	 ZYB.


Input



In the first line there is the number of testcases HDU 5591	 ZYB.

For each teatcase:

the first line there is one number HDU 5591	 ZYB.

HDU 5591	 ZYB,HDU 5591	 ZYB


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;
}



标签:5591,HDU,ZYB,player,int,number,two,players,first
From: https://blog.51cto.com/u_15870896/5838301

相关文章

  • HDU 4433 locker
    ProblemDescriptionApasswordlockerwithNdigits,eachdigitcanberotatedto0-9circularly.Youcanrotate1-3consecutivedigitsupordownino......
  • HDU 5586 Sum
    ProblemDescriptionThereisanumbersequence ,youcanselectainterval[l,r]ornot,allthenumbers  willbecome ..Afterthat,thesumofnnumbers......
  • HDU 4436 str2int
    ProblemDescriptionInthisproblem,youaregivenseveralstringsthatcontainonlydigitsfrom'0'to'9',inclusive.Anexampleisshownbelow.1......
  • HDU 5264 pog loves szh I
    ProblemDescriptionPoghaslotsofstrings.Andhealwaysmixestwoequal-lengthstrings.Forexample,therearetwostrings:"abcd"and"efgh".Afterm......
  • HDU 5639 Deletion
    ProblemDescriptionG with n verticesand m edges.Everytime,youcanselectseveraledgesanddeletethem.Theedgesselectedmustmeetthe......
  • HDU 5637 Transform
    ProblemDescriptionn integersaregiven.Foraninteger x youcandothefollowingoperations:+letthebinaryrepresentationof x be ......
  • HDU 1403 Longest Common Substring
    ProblemDescriptionGiventwostrings,youhavetotellthelengthoftheLongestCommonSubstringofthem.Forexample:str1=bananastr2=ciana......
  • HDU 4658 Integer Partition
    ProblemDescriptionGivenn,k,calculatethenumberofdifferent(unordered)partitionsofnsuchthatnopartisrepeatedkormoretimes.  ......
  • HDU 5638 Toposort
    ProblemDescriptionn verticesand m edges.Youareallowedtodeleteexact k InputT indicatingthenumberoftestcases.Fore......
  • HDU 4651 Partition
    ProblemDescriptionHowmanywayscanthenumbers1to15beaddedtogethertomake15?Thetechnicaltermforwhatyouareaskingisthe"numberofpart......