zoukankan      html  css  js  c++  java
  • Game!

    Description
    One day, zbybr is playing a game with blankcqk, here are the rules of the game:
    There is a circle of N stones, zbybr and blankcqk take turns taking the stones.
    Each time, one player can choose to take one stone or take two adjacent stones
    You should notice that if there are 4 stones, and zbybr takes the 2nd, the 1st and 3rd stones are still not adjacent.
    The winner is the one who takes the last stone.
    Now, the game begins and zbybr moves first.
    If both of them will play with the best strategy, can you tell me who will win the game?
    Input
    The first line of input contains an integer T, indicating the number of test cases (T≈100000).

    For each case, there is a positive integer N (N ≤ 10^18).

    Output
    Output the name of the winner.

    Sample Input
    2
    1
    2
    Sample Output
    zbybr
    zbybr

    解题思路:

    这也是一道博弈类型的题,可以拿走一块或者两块石头,zbybr先手,利用对称局势
    #include <stdio.h>
    int main()
    {
        int t;
        long long n;
        scanf("%d",&t);
        while(t--)
        {
            scanf("%lld",&n);
            if(n>=3)
                printf("blankcqk
    ");
            else
                printf("zbybr
    ");
        }
        return 0;
    }
  • 相关阅读:
    【转载】以太网帧类型速查表
    oracle 无法解析指定的连接标识符
    最近观影有感~
    myeclipse 8.5 安装svn插件
    Symbian S60 设备配置 IMAP
    VS 2008 自动缩进修改
    RGB YUV [转]
    NoteExpress 无法访问国外数据库
    小s坐月子
    2011124 code
  • 原文地址:https://www.cnblogs.com/wkfvawl/p/8666085.html
Copyright © 2011-2022 走看看