第六届“浪潮杯”山东省ACM C Game!

Game!

Time Limit: 1000 ms  Memory Limit: 65536 KiB
Submit  Statistic  Discuss

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.

Sample Input

2
1
2

Sample Output

zbybr
zbybr

Hint

Source

“浪潮杯”山东省第六届ACM大学生程序设计竞赛

题意:题目很简单,就是给n个石子围成的环,两个人轮流操作。一次只能取一个,或者相邻的两个,问谁能赢。。。

思路:很明显,n>=2时,先手一步就把环给断开了,那么就只能后手赢了,先手只能是可怜的取1-2个这样子的。。。

代码:

#include
#include
#include
#define ll long long
using namespace std;
int t;
ll n;


int main()
{
    scanf("%d",&t);
    while(t--)
    {
        scanf("%lld",&n);
        if(n > 2) puts("blankcqk");
        else puts("zbybr");
    }
    return 0;
}

你可能感兴趣的:(第六届“浪潮杯”山东省ACM C Game!)