标签:build href names logs uil nss include put tps
题目
?
?
莫名A了
?
?
#include <bits/stdc++.h>
using namespace std;
string s1,s2;
void build(int l1,int r1,int l2,int r2)
{
int root=l1,p=l2;
if(l1>r1) return;
while(s2[p]!=s1[root] && p<=r2) p++;
int cnt=p-l2;
build(l1+1,l1+cnt,l2,p-1);
build(l1+cnt+1,r1,p+1,r2);
printf("%c",s1[root]);
}
int main()
{
while(cin>>s1>>s2)
{
build(0,s1.length()-1,0,s2.length()-1);
puts("");
}
return 0;
}
【UVA】536 Tree Recovery(树型结构基础)
标签:build href names logs uil nss include put tps
原文地址:http://www.cnblogs.com/noblex/p/7966658.html