Game!

本文介绍了一款关于取石子的简单博弈游戏,探讨了zbybr与blankcqk两位玩家如何通过最优策略决定胜负。文章通过实例分析,揭示了不同数量石子下胜者的规律。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Game!

Time Limit: 1000MS Memory Limit: 65536KB
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
2
1
2
Example Output
zbybr
zbybr
Hint
Author

题目大意:

             石子围成一圈,zbybr和blankcqk轮流取石子,每人可以一次取一个,也可以取相邻的两个。zbybr先开始。

think:

         这是一道简单的博弈论问题(还是英文问题哦),可以试着推演一下,就可以知道结果。

         我在比赛时,开始就推三个的情况(1, 2的情况已给),然后一直推到了7,发现之后都是blankcpy赢,然后又回来看了一下,理了理思路,就可以了。

代码实现:

#include<stdio.h>
#include<string.h>
int main()
{
  int t;
  long long int a;
  scanf("%d", &t);
  while(t--)
  {
    scanf("%lld", &a);
    if(a==1||a==2)
    printf("zbybr\n");
    else
    printf("blankcqk\n");
  }
   return 0;
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值