标签:bit src display event ble space names gif c++
第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= 10000) 第2 - T + 1行:每行2个数分别是2堆石子的数量,中间用空格分隔。(1 <= N <= 2000000)
共T行,如果A获胜输出A,如果B获胜输出B。
3 3 5 3 4 1 9
B A A
资料查看
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); for(int i=1; i<=n ;i++) { int ans = 0; int x,y; scanf("%d %d",&x, &y); if(x > y) swap(x,y); ans = (y-x)*(sqrt(5)+1)/2; if(x == ans) puts("B"); else puts("A"); } return 0; }
标签:bit src display event ble space names gif c++
原文地址:http://www.cnblogs.com/Draymonder/p/7298036.html