12904
[골5] 12904 - A와 B
#include #include #include using namespace std; #pragma region 입출력 속도향상 #define FAST_IO() \ {\ ios::sync_with_stdio(false);\ cin.tie(NULL); \ cout.tie(NULL); \ }\ #pragma endregion int main() { FAST_IO(); string s, t; cin >> s >> t; while (t.length() != s.length()) { if (t.back() != 'A') { t.pop_back(); reverse(t.begin(), t.end()); } else t.pop_back(); } cout