Game

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1340    Accepted Submission(s): 891

Problem Description
Alice and Bob are playing a game.
The game is played on a set of positive integers from 1 to n.
In one step, the player can choose a positive integer from the set, and erase all of its divisors from the set. If a divisor doesn't exist it will be ignored.
Alice and Bob choose in turn, the one who cannot choose (current set is empty) loses.
Alice goes first, she wanna know whether she can win. Please judge by outputing 'Yes' or 'No'.
 
Input
There might be multiple test cases, no more than 10. You need to read till the end of input.
For each test case, a line containing an integer n. (1≤n≤500)
 
Output
A line for each test case, 'Yes' or 'No'.
 
Sample Input
1
 
Sample Output
Yes
 
 
 
之前邀请赛的原题,当是写了几个数发现的规律。但是不知道为什么。。。。
 
 
其实可以把 1~n 转化为  2~n 
如果2~n 先手必败的话,那么先手可以第一次选1,把必败状态转移给后手;
如果2~n 先手必胜的话,多一个1其实是没有影响的。
证毕;
 
 
 #include <bits/stdc++.h>
#define lowbit(x) (x)&(-x)
using namespace std;
int main()
{
int n;
while(~scanf("%d",&n))
cout<<"Yes"<<endl;
}

HDU6312 Game (多校第二场1004) 简单博弈的更多相关文章

  1. hdu6312 2018杭电多校第二场 1004 D Game 博弈

    Game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  2. HDU 4614 (13年多校第二场1004)裸线段树

    题意:给你N个花瓶,编号是0  到 N - 1 ,初始状态花瓶是空的,每个花瓶最多插一朵花. 然后有2个操作. 操作1,a b c ,往在a位置后面(包括a)插b朵花,输出插入的首位置和末位置. 操作 ...

  3. 多校第二场 1004 hdu 5303 Delicious Apples(背包+贪心)

    题目链接: 点击打开链接 题目大意: 在一个周长为L的环上.给出n棵苹果树.苹果树的位置是xi,苹果树是ai,苹果商店在0位置,人的篮子最大容量为k,问最少做多远的距离可以把苹果都运到店里 题目分析: ...

  4. HDU6581 Vacation (HDU2019多校第一场1004)

    HDU6581 Vacation (HDU2019多校第一场1004) 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6581 题意: 给你n+1辆汽车, ...

  5. 2019牛客多校第二场 A Eddy Walker(概率推公式)

    2019牛客多校第二场 A Eddy Walker(概率推公式) 传送门:https://ac.nowcoder.com/acm/contest/882/A 题意: 给你一个长度为n的环,标号从0~n ...

  6. hdu 5301 Buildings (2015多校第二场第2题) 简单模拟

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5301 题意:给你一个n*m的矩形,可以分成n*m个1*1的小矩形,再给你一个坐标(x,y),表示黑格子 ...

  7. HDU 多校对抗赛第二场 1004 Game

    Game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  8. 2015 多校赛 第二场 1004 hdu(5303)

    Problem Description There are n apple trees planted along a cyclic road, which is L metres long. You ...

  9. 2018 Multi-University Training Contest 2 杭电多校第二场

    开始逐渐习惯被多校虐orz  菜是原罪 1004  Game    (hdoj 6312) 链接:http://acm.hdu.edu.cn/showproblem.php?pid=6312 虽然披着 ...

随机推荐

  1. 01-19asp.net网站--关于“应用程序中的服务器错误(需添加"Jquery"ScriptRescourseMapping)”

    一般打开网页进行加载时(有缓存),会弹出以下对话框. 但是如果网页加载后出现以下错误,就是应用程序的问题了.如果出现这种问题,就需要在安装Csharp的根目录下,找到一个名为.dll结尾的Jquery ...

  2. 关于RandomizedSearchCV 和GridSearchCV(区别:参数个数的选择方式)

    # -*- coding: utf-8 -*- """ Created on Tue Aug 09 22:38:37 2016 @author: Administrato ...

  3. leetcode628

    这道题十分不容易啊,做到半夜. class Solution { public: static int cmp628(int a, int b) { return a > b; } static ...

  4. 【转载】基于TINY4412的Andorid开发-------简单的LED灯控制

    阅读目录(Content) 一.编写驱动程序 二.编写代码测试驱动程序 三.编写HAL代码 四.编写Framework代码 五.编写JNI代码 六.编写App 参考资料: <Andriod系统源 ...

  5. DAY8-python之网络编程

    一.客户端/服务器架构 1.硬件C/S架构(打印机) 2.软件C/S架构 互联网中处处是C/S架构 如黄色网站是服务端,你的浏览器是客户端(B/S架构也是C/S架构的一种) 腾讯作为服务端为你提供视频 ...

  6. POJ 2176 Folding(区间DP)

    题意:给你一个字符串,请把字符串压缩的尽量短,并且输出最短的方案. 例如:AAAAA可压缩为5(A), NEERCYESYESYESNEERCYESYESYES可压缩为2(NEERC3(YES)). ...

  7. SQL 连贯操作 [1]

    一. 连贯入门 查找到 id 为 1,2,3,4 中按照创建时间的倒序的前两位. 在 Home/controller/UserController.class.php 下插入 1.连贯操作入门 $us ...

  8. 两个进程之间的通讯——pipe 管道

    在实际工作中,已经编辑好了NIPT_analysis的软件,该软件一般的输入文件是sam文件,但是为了集成进入测序仪器,需要直接从比对软件的标准输出中读取sam文件,省去了比对软件和NIPT_anal ...

  9. AR# 30522:LogiCORE RapidIO - How do system_reset and link_reset work?

    Description How do system_reset and link_rest work? Solution lnk_linkreset_n (input): In Xilinx SRIO ...

  10. WebGoat系列实验Denial of Service & Insecure Communication

    WebGoat系列实验Denial of Service & Insecure Communication ZipBomb 服务器仅接收ZIP文件,将上传的文件解压,进行操作之后删除.已知服务 ...