#include <bits/stdc++.h>
using namespace std;
vector<char> pre, in, post;
int cnt = 0;
string a,b;
void recons(int l, int r)
{
if(l >= r) return;
char root = pre[cnt++];
int m = distance(in.begin(), find(in.begin(), in.end(), root));
recons(l, m);
...