真-模拟


1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cmath> 5 #include <algorithm> 6 #include <string> 7 using namespace std; 8 9 char s[100000]; 10 11 void T(int l,int r){ 12 bool f=true; 13 for(int i=l;i<r;++i)f&=s[i]==s[i+1]; 14 if(f)putchar('A'+(s[l]=='1')); 15 else putchar('C'),T(l,(l+r)/2),T((l+r)/2+1,r); 16 } 17 int main(){ 18 scanf("%s",s+1); 19 T(1,strlen(s+1)); 20 }