hdoj 5591 ZYB's Game 【水题】
来源:互联网 发布:sql server 2008下载 编辑:程序博客网 时间:2024/06/04 18:53
ZYB's Game
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 20 Accepted Submission(s): 15
Problem Description
players guess a number in turns,the player who exactly guesses
the number now is bigger or smaller than
Now if only two players are play the game,and both of two players know the
will win when
Input
In the first line there is the number of testcases T .
For each teatcase:
the first line there is one numberN .
1≤T≤100000 ,1≤N≤10000000
For each teatcase:
the first line there is one number
Output
For each testcase,print the ans.
Sample Input
13
Sample Output
1
找规律:奇数为1,偶数为0。
AC代码:
#include <cstdio>#include <cstring>#include <cmath>#include <cstdlib>#include <algorithm>#include <queue>#include <stack>#include <map>#include <set>#include <vector>#define INF 0x3f3f3f#define eps 1e-8#define MAXN (100+10)#define MAXM (100000)#define Ri(a) scanf("%d", &a)#define Rl(a) scanf("%lld", &a)#define Rf(a) scanf("%lf", &a)#define Rs(a) scanf("%s", a)#define Pi(a) printf("%d\n", (a))#define Pf(a) printf("%.2lf\n", (a))#define Pl(a) printf("%lld\n", (a))#define Ps(a) printf("%s\n", (a))#define W(a) while(a--)#define CLR(a, b) memset(a, (b), sizeof(a))#define MOD 1000000007#define LL long long#define lson o<<1, l, mid#define rson o<<1|1, mid+1, r#define ll o<<1#define rr o<<1|1using namespace std;int main(){ int t; Ri(t); W(t) { int n; Ri(n); if(n & 1) printf("1\n"); else printf("0\n"); } return 0;}
0 0
- hdoj 5591 ZYB's Game 【水题】
- HDOJ 5591 ZYB's Game
- hdoj-5591-ZYB's Game
- HDOJ 5591 ZYB's Game(简单博弈)
- 【博弈】HDOJ ZYB's Game 5591
- HDOJ 5591 ZYB's Game 【简单博弈 】
- HDU 5591 ZYB's Game
- HDU 5591 ZYB's Game
- hdoj ZYB's Game 5901 (数学规律题)
- HDU 5591 ZYB's Game(取石子)
- HDU 5591 ZYB's Game(博弈)
- 杭电5591 ZYB's Game
- hdu 5591 ZYB's Game(水)
- hdu5591 ZYB's Game
- ZYB's Game
- hdoj 5590 ZYB's Biology 【水题】
- ZYB's Game解题报告
- HDOJ 5590 ZYB's Biology
- [简单实用系列] 说明
- JavaFX入门(五):使用CSS样式美化你的UI控件
- fedora 安装中文输入法
- js下载文件以及下载文件名乱码问题的解决
- android5.0自带兼容控件__Toolbar
- hdoj 5591 ZYB's Game 【水题】
- Hdoj.5407 CRB and Candies【数论。。。】 2015/12/05
- sax/dom/jdom/dom4j的区别?
- 黑马程序员——C语言基础---指针
- hdoj 5592 ZYB's Premutation 【线段树插空】
- 从DeepLearnToolbox-master看CNN
- Android生成keystore的两种方式
- 【Leetcode】Spiral Matrix II
- 同时安装Java 1.7和1.8