HDU2188 选拔志愿者

 1 /*
 2  HDU2188 选拔志愿者
 3  http://acm.hdu.edu.cn/showproblem.php?pid=2188
 4  博弈论 巴什博奕
 5  巴什博奕要注意n<=m时是必胜态
 6  *
 7  *
 8  *
 9  *
10  */
11 #include <cstdio>
12 int main()
13 {
14     int t;
15     scanf("%d",&t);
16     while(t--)
17     {
18         int n,m;
19         scanf("%d%d",&n,&m);
20         if(n<=m)
21         {
22             printf("Grass\n");
23             continue;
24         }
25         m++;
26         if(n%m==0)
27             printf("Rabbit\n");
28         else
29             printf("Grass\n");
30     }
31     return 0;
32 }

 

posted @ 2017-03-16 11:24  BBBob  阅读(112)  评论(0编辑  收藏  举报