zoukankan      html  css  js  c++  java
  • Life Winner Bo (博弈论)

    kind:维持让对手处于(奇数,奇数)的状态,就能赢。

    rook:维持让对手处于(A,A)相等的状态,就能赢。

    knight:画图找规律,没有到达终点的就是平局。

    queen:威佐夫博弈论,终点不一样。

    #include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
        int T, type, n, m;scanf("%d",&T);
        while(T --){
            scanf("%d%d%d", &type, &n, &m);
            if(type == 1){
                if(n%2 == 0 || m%2 == 0)printf("B
    ");
                else printf("G
    ");
            }else if(type == 2){
                if(n != m) printf("B
    ");
                else printf("G
    ");
            }else if(type == 3){
                if(n > m) swap(n, m);
                if(n == m && n%3 == 1) printf("G
    ");
                else if((n + 1) == m && (m % 3) == 0) printf("B
    ");
                else printf("D
    ");
            }else{
                n --; m --;
                if(n > m) swap(n, m);
                int t = (int)((1.0 * sqrt(5.0) + 1) / 2 * (m - n) );
                if(n == t) printf("G
    ");
                else printf("B
    ");
            }
        }
        return 0;
    }
    more crazy more get!
  • 相关阅读:
    java-工具代码
    idea-常用快捷键
    idea-环境配置
    mysql-常用命令
    Java IO流学习总结
    Java类加载机制
    Struts2标签 %{ } %{# }详解
    EL语法
    SQL语句
    在servlet转向jsp页面的路径问题
  • 原文地址:https://www.cnblogs.com/wethura/p/9792249.html
Copyright © 2011-2022 走看看