题目
思路:
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define lson p << 1
#define rson p << 1 | 1
const int maxn = 1e6 + 5, inf = 1e18 * 3, maxm = 4e4 + 5, mod = 1e9 + 7;
int a[maxn], b[maxn];
int n, m;
string s;
bool vis[maxn];
vector<int> G[maxn];
int from, to;
vector<int> tmp, vec;
int deg[maxn];
void dfs(int u, int p){
if(u == to && p == from) return;
if(vis[u]) return;
vis[u] = 1;
tmp.pb(u);
if(u == to){
vec = tmp;
return;
}
for(auto v : G[u]){
dfs(v, u);
}
tmp.pop_back();
}
void solve(){
int res =