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\n"); else printf("G\n"); }else if(type == 2){ if(n != m) printf("B\n"); else printf("G\n"); }else if(type == 3){ if(n > m) swap(n, m); if(n == m && n%3 == 1) printf("G\n"); else if((n + 1) == m && (m % 3) == 0) printf("B\n"); else printf("D\n"); }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\n"); else printf("B\n"); } } return 0; }
more crazy more get!