标签:ace using debug cout bad 不同 namespace ons bit
BADC
BDCA
ABCD
1 #include <bits/stdc++.h> 2 const int INF=0x3f3f3f3f; 3 typedef long long LL; 4 const double eps =1e-8; 5 const int mod=1e9+7; 6 const int maxn=1e5+10; 7 using namespace std; 8 9 string a; 10 11 void solve(string b,string c) 12 { 13 string b1,b2,c1,c2; 14 int lenb=b.size(); 15 int lenc=c.size(); 16 a+=c[lenc-1]; 17 int pos=b.find(c[lenc-1],0); 18 b1=b.substr(0,pos); 19 b2=b.substr(pos+1,(lenb-pos-1)); 20 c1=c.substr(0,pos); 21 c2=c.substr(pos,(lenb-pos-1)); 22 if(b1.size()&&c1.size()) solve(b1,c1); 23 if(b2.size()&&c2.size()) solve(b2,c2); 24 } 25 26 int main() 27 { 28 #ifdef DEBUG 29 freopen("sample.txt","r",stdin); 30 #endif 31 32 string b,c; 33 cin>>b>>c; 34 solve(b,c); 35 cout<<a<<endl; 36 37 return 0; 38 }
-
标签:ace using debug cout bad 不同 namespace ons bit
原文地址:https://www.cnblogs.com/jiamian/p/12578709.html