func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 2 * 100 * 1000 + 100;   int n, dp[MAXN], d[MAXN], mark[MAXN], ans[MAXN], D = 0, MIN = MAXN;   pair<int, int> par[MAXN];   vector<pair<int, int> > g[MAXN];   vector<int> q, depth[MAXN], res;   void bfs() {     for (int i = 0; i < q.size(); i++) {       int v = q[i];       for (int j = 0; j < g[v].size(); j++) {         int u = g[v][j].first;         if (!mark[u]) {           mark[u] = true;           par[u] = make_pair(v, (g[v][j].second + 1) % 2);           d[u] = d[v] + 1;           D = max(D, d[u]);           depth[d[u]].push_back(u);           q.push_back(u);         }       }     }   }   int main() {     cin >> n;     for (int i = 0; i < n - 1; i++) {       int x, y;       cin >> x >> y;       x--, y--;       g[x].push_back(make_pair(y, 0));       g[y].push_back(make_pair(x, 1));     }     d[0] = 0;     mark[0] = true;     q.push_back(0);     depth[0].push_back(0);     bfs();     for (int i = D - 1; i >= 0; i--) {       for (int j = 0; j < depth[i].size(); j++) {         int v = depth[i][j];         for (int z = 0; z < g[v].size(); z++) {           int u = g[v][z].first;           if (u != par[v].first) dp[v] += dp[u] + g[v][z].second;         }       }     }     ans[0] = dp[0];     MIN = ans[0];     for (int i = 1; i <= D; i++) {       for (int j = 0; j < depth[i].size(); j++) {         int v = depth[i][j];         int p = par[v].first;         ans[v] = ans[p];         if (par[v].second == 0)           ans[v] -= 1;         else           ans[v] += 1;         MIN = min(ans[v], MIN);       }     }     cout << MIN << endl;     for (int i = 0; i < n; i++)       if (ans[i] == MIN) cout << i + 1 <<    ;     return 0;   }   