博弈论---Game!

- 日理万妓 2022-07-12 11:17 276阅读 0赞

Problem 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.

Example Input

  1. 2
  2. 1
  3. 2

Example Output

  1. zbybr
  2. zbybr
  3. 题意大概:有一圈石头,每次只能拿一个或者相邻两个,zbybr先拿,blankcqk后拿,如果轮到某人时没有了石头,则这个人输;
  4. #include <stdio.h>
  5. int main(){
  6. int n;
  7. long long int m;
  8. scanf("%d",&n);
  9. for (int i=0;i<n;i++){
  10. scanf("%lld",&m);
  11. if (m<3){
  12. printf("zbybr\n");
  13. }
  14. else{
  15. printf("blankcqk\n");
  16. }
  17. }
  18. }

发表评论

表情:
评论列表 (有 0 条评论,276人围观)

还没有评论,来说两句吧...

相关阅读

    相关 博弈论

    博弈论 看了两天博弈,做了一点题,写一写,把自己学会的东西记录下来。 巴什博奕(Bash Game) 只有一堆n个物品,两个人轮流从这

    相关 博弈论

    博弈论 巴什博弈 尼姆博弈 威佐夫博弈 巴什博弈 问题类型: 只有一堆n个物品,两个人从轮流中取出(1~m)个,最后取光者得胜; bo

    相关 博弈论问题

    \\ 博弈论问题——双人取棋子 \\ 1.问题描述 一共有19枚棋子,两人轮流取,每人每次可以取1枚或2枚或3枚,己方先取,拿到最后一枚棋子算输,问何种取法可以