(Jizhong) 1596.] [GDKOI2004 stone game (game)

(File IO): input: game.in output: game.out
time limit: 1000 ms space constraints: 262144 KB specific restrictions
Goto ProblemSet


Title Description
Xiaoyong and small is indeed good friends, they often play together. Today they play the game is this: there is a paved by a square stone floor, it is high 2 2 , the length is N N . The following is an example N = 3 N=3 situation:
Here Insert Picture Description
now they take turns in length and width, respectively, are placed above 1 1 and 2 2 rectangular stones, can be placed horizontally heel, but just laying on the floor on two square stone uncovered when someone can not put up his lose.
For example, a particular game might look like, real small stones placed horizontally on the left above, as follows:
Here Insert Picture Description
then Xiaoyong stones horizontally on the right below, as follows:
Here Insert Picture Description
The little real stone can not recapture, so he lost . Xiaoyong compare comity, he let small solid first place. Of course, the above method may not be the best, and now if they are very smart, you programmed judge who will win.


Enter
the first line an integer C ( 1 < = C < = 100 ) C(1<=C<=100) indicates the number of test data. Then there C C lines, each a behavioral test data, test data each has only one integer N ( 1 < = N < = 100 ) N(1<=N<=100)

Output
Output C C lines of the corresponding test data output. For each result, if it is, then it wins Xiaoyong output x i a The Y The n g xiaoyong , or it is a small win real output x i a The s h i xiaoshi .


Sample input
1
1

Sample output
xiaoshi


Data range limit


Problem-solving ideas
optimal strategy game stone is such that, if the first place, to heel, or to be put either of the other methods, then, if the other horizontally, then it just above or just below a stone horizontally as if the other heel, heel also, according to this method, it is easy to get to this conclusion: when n is an odd little real win, win Xiaoyong otherwise.


Code

#include<iostream>
#include<cstring>
#include<string>
#include<cstdio>
#include<algorithm>
#include<iomanip>
#include<cmath>
int c,n;
int main(){
    freopen("game.in","r",stdin);
    freopen("game.out","w",stdout);
    scanf("%d",&c);
    for(int i=1;i<=c;i++)
    {
        scanf("%d",&n);
	if(n%2!=0)
	   printf("xiaoshi\n");
	else
	   printf("xiaoyong\n");
    }
}
Published 119 original articles · won praise 8 · views 4909

Guess you like

Origin blog.csdn.net/kejin2019/article/details/105012361