hdu 6312
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'.
For each test case, a line containing an integer n. (1≤n≤500)
// 当2到N为必胜局面时,先手就去1和必胜时应取得数,则先手一定必胜
// 当2到N为必败局面时,先手就取1,则把必败局面给后手,则先手必胜
int main()
{ int n;
while(~scanf("%d",&n)){
printf("Yes\n");
}
return ;
}
hdu 6312的更多相关文章
- HDU 6312 - Game - [博弈][杭电2018多校赛2]
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6312 Problem Description Alice and Bob are playing a ...
- HDU - 6312( 2018 Multi-University Training Contest 2)
bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6312 输出前几项,都是"Yes" #include <bits ...
- HDU 6312.Game-博弈-签到题 (2018 Multi-University Training Contest 2 1004)
2018 Multi-University Training Contest 2 6312.Game 博弈,直接官方题解,懒了. 考虑将游戏变成初始时只有2~n,如果先手必胜的话,那么先手第一步按这样 ...
- ( 2018 Multi-University Training Contest 2)
2018 Multi-University Training Contest 2) HDU 6311 Cover HDU 6312 Game HDU 6313 Hack It HDU 6314 Mat ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
- hdu 4859 海岸线 Bestcoder Round 1
http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...
- HDU 4569 Special equations(取模)
Special equations Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- HDU 4006The kth great number(K大数 +小顶堆)
The kth great number Time Limit:1000MS Memory Limit:65768KB 64bit IO Format:%I64d & %I64 ...
随机推荐
- 069 Sqrt(x) 求平方根
实现 int sqrt(int x) 函数.计算并返回 x 的平方根.x 保证是一个非负整数.案例 1:输入: 4输出: 2案例 2:输入: 8输出: 2说明: 8 的平方根是 2.82842..., ...
- JS filter使用
filter 用于筛选数组中符合条件的所以元素,filter只能接受函数 注意:filter只返回筛选结果,不会对原来数组改变 实现方法: <html lang="en"&g ...
- MVC View与Controller分离
新建了一个 Separate 解决方案, 如下图 Separate.UI UI层. 引用 Separate.Home Separate.Home 把Home控制器分享到 一个类库中 并引用(Sy ...
- 变更gcc版本
当前的GCC版本为GCC-4.2,需要切换到GCC-3.4.首先,你需要去你的usr/bin/下去看看有没有gcc-3.4这样文件,如果没有的话,就安装一下吧: apt-get install gcc ...
- python中的getcwd
Help on built-in function getcwd in module posix: getcwd(...) getcwd() -> path Return a ...
- Protocol Buffer学习教程之开篇概述(一)
1. Protocol Buffer是什么 Protocol Buffer是google旗下的产品,用于序列化与反序列化数据结构,但是比xml更小.更快.更简单,而且能跨语言.跨平台.你可以把你的数据 ...
- DA层(数据访问层)的方法不用静态的
1.静态方法,不会经过构造函数,所以你不能通过构造函数来初始参数,你只能通过传递参数,来初始他当你有多种参数需要传递的时候,你就要不断重载他了.当然你可以用参数型的类型,不过如果参数有一定结构,就很麻 ...
- Android商城开发系列(二)——App启动欢迎页面制作
商城APP一般都会在应用启动时有一个欢迎界面,下面我们来实现一个最简单的欢迎页开发:就是打开商城App,先出现欢迎界面,停留几秒钟,自动进入应用程序的主界面. 首先先定义WelcomeActivity ...
- js修改文档的样式
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Java ...
- 【Python图像特征的音乐序列生成】关于mingus一个bug的修复,兼改进情感模型
mingus在输出midi文件的时候,使用这样的函数: from mingus.containers import NoteContainer from mingus.midi import midi ...