#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
vector<int> graph[MAXN];
int values[MAXN];
bool visited[MAXN];
int n;
int gcd(int a, int b) {
return b ? gcd(b, a % b) : a;
}
pair<int, int> dfs_farthest(int u, int parent, int depth) {
pair<int, int> res = {depth, u};
for (int v : graph[u]) {
if (v != parent && visited[v]) {
auto temp = dfs_farthest(v, u, depth + 1);
if (temp.first > res.first) {
res = temp;
}
}
}
return res;
}
int compute_diameter(vector<int>& nodes) {
if (nodes.empty()) return 0;
}
int main() {
cin >> n;
}
(点赞)删除文本