📄 usaco_3_4_2_heritage.cpp
字号:
/*
ID: wangyuc2
PROB:heritage
LANG: C++
*/
/*
貌似没什么说滴……已知树的中序和先序序列,求个后序的……
*/
#include <fstream>
#include <iostream>
#include <string>
#include <memory>
#include <algorithm>
#include <bitset>
#include <queue>
#include <vector>
#define MAXV 202
#define MAXE 1000
#define cin fin
using namespace std;
ifstream fin("heritage.in");
ofstream fout("heritage.out");
void lrd(string s1,string s2)
{
int i;
if(s1.size()==0) return;
i=s1.find(s2[0]);
lrd(s1.substr(0,i),s2.substr(1,i));
lrd(s1.substr(i+1),s2.substr(i+1));
fout<<s1[i];
}
int main()
{
int i;
string s1,s2;
cin>>s1;
cin>>s2;
lrd(s1,s2);
fout<<endl;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -