hdu 6312
2024-09-04 16:30:23
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'.
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)
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
Source
Recommend
// 当2到N为必胜局面时,先手就去1和必胜时应取得数,则先手一定必胜
// 当2到N为必败局面时,先手就取1,则把必败局面给后手,则先手必胜
int main()
{ int n;
while(~scanf("%d",&n)){
printf("Yes\n");
}
return ;
}
最新文章
- java SE编写图形应用程序
- vs 中怎么用c改变部分字体颜色
- 整理: Android HAL
- 框架模式 MVC 在Android中的使用
- Oracle12c功能增强 新特性之管理功能的增强
- JQuery的几种页面加载完执行三种方式
- LintCode 推断一个二叉树树是否是还有一个二叉树的子书
- delphi中用代码实现注册Ocx和Dll(有点怪异,使用CallWindowProc来调用指定函数DllRegisterServer)
- C++ 友元函数的函数指针
- 洗礼灵魂,修炼python(4)--从简单案列中揭示常用内置函数以及数据类型
- 解读vscode断点调试配置文件【待续】
- ajax的一些相关
- Vue原理--虚拟DOM
- MySQL查询命令_SELECT 子查询
- python的Web框架,类视图
- DOM结构及优化
- Delegate event 委托事件---两个From窗体使用委托事件
- MySQL的初次见面礼基础实战篇
- android RadioButton文字居中的方法
- memset struct含有string的崩溃