BC 65 game
2015-12-06 18:58
281 查看
主持人一直某个数字在1到n范围,假设甲乙已经知道,甲先猜乙后,都采用最优策略,主持人说偏大还是偏小,不断缩小范围,问最后乙能会获胜的X的取值的个数。
如果n为奇数,那么仅当x=n/2乙必然获胜,若为奇数乙不可能获胜。
如果n为奇数,那么仅当x=n/2乙必然获胜,若为奇数乙不可能获胜。
#include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <vector> #include <queue> #include <set> #include <map> #include <string> #include <math.h> #include <stdlib.h> #include <time.h> using namespace std; int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); int T; int n; scanf("%d",&T); while(T--) { scanf("%d",&n); if(n%2 == 1)printf("1\n"); else printf("0\n"); } return 0; }
相关文章推荐
- ubuntu(虚拟机)中使用minicom
- ubuntu(虚拟机)中使用minicom
- js返回,页面暂存
- linux上安装mono发布.net网站步骤
- Redis高级进阶(二)
- (转)No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=arm64, VA 解决办法
- Python基础04 运算
- Python基础03 序列
- mysql安装及主从
- 验证登录页面
- Python基础 基本数据类型
- 读《50 Android Hacks》笔记整理Hack 24~Hack 30
- Node.js开发环境搭建
- 直接插入排序
- linux内核参数注释与优化 【转】
- Asoc dapm(五) - dapm widget链表更新
- Linux学习笔记(1)-嵌入式Linux概念
- Spring据源配置
- ASP.NET上实现
- 黑马程序员——OC之对象和方法之间的关系