ユーフォリアと量子ゆらぎの速読
http://qoj.xust-kcsoft.club/problem/10002
慎重な分析
奇数道路、
でも、道路、
最後に、逆出力
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n;
while(n) {
if(n&1) {
s += 'A';
n = (n - 1) >> 1;
}
else {
s += 'B';
n = (n - 2) >> 1;
}
}
for(int i = s.size() - 1;i >= 0; -- i) cout << s[i];
return 0;
}