51 Nod 1072 威佐夫遊戲
阿新 • • 發佈:2018-12-11
#include<bits/stdc++.h> #include<stdio.h> #include<iostream> #include<cmath> #include<math.h> #include<queue> #include<set> #include<map> #include<iomanip> #include<algorithm> #include<stack> using namespace std; #define inf 0x3f3f3f3f typedef long long ll; int main() { #ifndef ONLINE_JUDGE freopen("in.txt","r",stdin); #endif // ONLINE_JUDGE int t;ll a,b;ll tmpa,tmpb;ll k; scanf("%d",&t); while(t--) { scanf("%lld%lld",&tmpa,&tmpb); a=min(tmpa,tmpb); b=max(tmpa,tmpb); k=b-a; if((ll)(k*(1+sqrt(5))/2)==a) puts("B"); else puts("A"); } return 0; }