Submission
Status:
--------------------
Subtask/Task Score:
0/100
Score: 0
User: solarsunny
Problemset: Bakushin's Genius Game
Language: cpp
Time: 0.011 second
Submitted On: 2025-10-05 14:50:02
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
for(int i=0; i<t; i++) {
int n;
string turn = "A";
cin >> n;
if(n==0) {
if(turn == "A") {
cout << "B" << "\n";
} else {
cout << "A" << "\n";
}
continue;
}
if(n==1) {
cout << turn << "\n";
continue;
}
while (n%2==0) {
n = n/2;
if(turn == "A") {
turn = "B";
}else {
turn = "A";
}
}
cout << turn << "\n";
continue;
}
return 0;
}