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 }
  • 相关阅读:
    A. Playing with Paper
    手摇算法
    perl之创建临时文件夹遇到同名文件该咋办
    B. Two Buttons
    A Pangram
    shell的面试题
    A. Game
    B. Drazil and His Happy Friends
    A. Drazil and Date
    2道阶乘的算法题
  • 原文地址:https://www.cnblogs.com/tingtin/p/9369028.html
Copyright © 2011-2022 走看看