#include #include #include using namespace std; mapmemo; bool dfs(string s) { if(memo.find(s)!=memo.end())return memo[s]; bool win=false; for(int j=0;j=0&&t[i]=='A';i--) { t[i]='B'; if(!dfs(t))win=true; } } return memo[s]=win; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); /* for(int len=1;len<=4;len++) { for(int i=0;i<1<>j&1)s[j]='B'; cout<>N; string S;cin>>S; int cur=0; for(int j=0;j