1.图的遍历 答案就是所有边的两边然后减去离1最远点到1的距离 // 图的遍历 #include <bits/stdc++.h> using namespace std; const int N = 1e5+10; typedef long long ll; vector e[N]; int ans; void dfs(int x, int fa, int w) { for(auto to : e[x]) { if (to == fa) { continue; } dfs(to, x, w+1); } ans = max(ans, w); } int main() { int...