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!
原文地址:https://www.cnblogs.com/wethura/p/9792249.html