博弈论---Game!
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
题意大概:有一圈石头,每次只能拿一个或者相邻两个,zbybr先拿,blankcqk后拿,如果轮到某人时没有了石头,则这个人输;
#include <stdio.h>
int main(){
int n;
long long int m;
scanf("%d",&n);
for (int i=0;i<n;i++){
scanf("%lld",&m);
if (m<3){
printf("zbybr\n");
}
else{
printf("blankcqk\n");
}
}
}
还没有评论,来说两句吧...