活用sg即可
代码及其注释如下:
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define debug cout<<"debug"<<endl
mt19937 rd(time(0));
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
const double eps = 1e-5;
const double PI = 3.14159265358979323;
const int N = 2e5+10, M = 2*N, mod = 1e9+7;
const int INF = 0x3f3f3f3f;
int n, m, k;
// 普通sg函数, 按题意来, 铁寄
//int sg(int x)
//{
cout<<u<<endl;
// if(f[x] != -1) return f[x];
// unordered_set<int> S;
// // 从这里可以知道一个数的sg值即为该数二进制位数-2
// // 当然, 打表看sg值速度更快
// for(int i = 1; i<=x/2; i++)
// {
// if(i+i == x) break;
// S.insert(sg(i));
// }
// for(int i = 0; ; i++)
// if(!S.count(i)) return f[x] = i;
//}
int sg(int x)
{
// cout<<u<<endl;
int res = 0;
ll w = 2;
while(x>w)
{
x -= w;
res++;
w<<=1;
}
return res;
}
void prf(int x)
{
while(x)
{
if(x&1) cout<<1;
else cout<<0;
x>>=1;
}
cout<<endl;
}
void solve()
{
cin>>n>>m;
int res = sg(n)^sg(m);
// prf(n), prf(m);
// cout<<sg(n)<<" "<<sg(m)<<endl;
cout<<(res == 0 ? "Bob" : "Alice")<<endl;
}
int main()
{
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
int T;
T = 1;
cin>>T;
while(T -- )
{
solve();
}
return 0;
}