zoukankan      html  css  js  c++  java
  • hdoj 2188 悼念512汶川大地震遇难同胞——选拔志愿者

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2188

    解题思路:典型的巴什博弈(巴什博弈:http://www.cnblogs.com/linqiuwei/p/3227146.html

     1 ///////////////////////////////////////////////////////////////////////////
     2 //problem_id: hdoj 2188
     3 //user_id: SCNU20102200088
     4 ///////////////////////////////////////////////////////////////////////////
     5 
     6 #include <algorithm>
     7 #include <iostream>
     8 #include <iterator>
     9 #include <iomanip>
    10 #include <cstring>
    11 #include <cstdlib>
    12 #include <string>
    13 #include <vector>
    14 #include <cstdio>
    15 #include <cctype>
    16 #include <cmath>
    17 #include <queue>
    18 #include <stack>
    19 #include <list>
    20 #include <set>
    21 #include <map>
    22 using namespace std;
    23 
    24 ///////////////////////////////////////////////////////////////////////////
    25 typedef long long LL;
    26 const double EPS=1e-8;
    27 const double PI=acos(-1.0);
    28 
    29 const int x4[]={-1,0,1,0};
    30 const int y4[]={0,1,0,-1};
    31 const int x8[]={-1,-1,0,1,1,1,0,-1};
    32 const int y8[]={0,1,1,1,0,-1,-1,-1};
    33 
    34 typedef int T;
    35 T max(T a,T b){ return a>b? a:b; }
    36 T min(T a,T b){ return a<b? a:b; }
    37 ///////////////////////////////////////////////////////////////////////////
    38 
    39 ///////////////////////////////////////////////////////////////////////////
    40 //Add Code:
    41 ///////////////////////////////////////////////////////////////////////////
    42 
    43 int main(){
    44     ///////////////////////////////////////////////////////////////////////
    45     //Add Code:
    46     int C,n,m;
    47     scanf("%d",&C);
    48     while(C--){
    49         scanf("%d%d",&n,&m);
    50         printf("%s
    ",n%(m+1)!=0? "Grass":"Rabbit");
    51     }
    52     ///////////////////////////////////////////////////////////////////////
    53     return 0;
    54 }
    55 
    56 ///////////////////////////////////////////////////////////////////////////
    57 /*
    58 Testcase:
    59 Input:
    60 2
    61 8 10
    62 11 10
    63 Output:
    64 Grass
    65 Rabbit
    66 */
    67 ///////////////////////////////////////////////////////////////////////////
  • 相关阅读:
    用css实现三角形
    css实现加载中的效果
    图片轮播图插件
    支付密码框
    angular里面ng-class的几个用法
    Redis数据恢复
    Jenkins简单介绍
    spring框架中定时器的配置及应用
    springMVC与freemarker的整合
    freemarker入门小例子
  • 原文地址:https://www.cnblogs.com/linqiuwei/p/3286229.html
Copyright © 2011-2022 走看看