zoukankan      html  css  js  c++  java
  • hdu 6312

    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
    ");
    7     }
    8     return 0;
    9 }
  • 相关阅读:
    iTestin云测试工具
    android 存储操作 大小显示换算 kb mb KB MB 读取
    android 发送短信 判断号码规则 判断字符数70
    android 震动 各种
    10.13总结
    10.8每日总结
    10.9
    10.15
    10.14
    10.12每日总结
  • 原文地址:https://www.cnblogs.com/tingtin/p/9369028.html
Copyright © 2011-2022 走看看