fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int n;
  4. pair <int, int> g[2010];
  5. int s[2010], fa[2010], f[2010][20];
  6. int dep[2010];
  7. vector <int> e[2010];
  8. int main()
  9. {
  10. cin >> n;
  11. for (int i = 1; i < n; i++)
  12. {
  13. int x, y;
  14. cin >> x >> y;
  15. g[i] = {x, y};
  16. e[x].push_back(y);
  17. e[y].push_back(x);
  18. }
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5288KB
stdin
4
1 2
2 3
3 4
stdout
Standard output is empty