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
");
23             continue;
24         }
25         m++;
26         if(n%m==0)
27             printf("Rabbit
");
28         else
29             printf("Grass
");
30     }
31     return 0;
32 }
原文地址:https://www.cnblogs.com/BBBob/p/6558533.html