菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
445
0

hdu 6312

原创
05/13 14:22
阅读数 80882

 

 

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. (1n500)
 

 

Output
A line for each test case, 'Yes' or 'No'.
 

 

Sample Input
1
 

 

Sample Output
Yes
 

 

Source
 

 

Recommend
chendu   |   We have carefully selected several similar problems for you:  6318 6317 6316 6315 6314 
 
 
 
 
1 // 当2到N为必胜局面时,先手就去1和必胜时应取得数,则先手一定必胜
2 // 当2到N为必败局面时,先手就取1,则把必败局面给后手,则先手必胜
3 int main()
4 {   int n;
5     while(~scanf("%d",&n)){
6         printf("Yes\n");
7     }
8     return 0;
9 }

 

发表评论

0/200
445 点赞
0 评论
收藏
为你推荐 换一批