diff --git a/Luogu/problem/P5197/P5197.cpp b/Luogu/problem/P5197/P5197.cpp new file mode 100644 index 00000000..f77b7733 --- /dev/null +++ b/Luogu/problem/P5197/P5197.cpp @@ -0,0 +1,15 @@ +#include + +using namespace std; + +int n, u, v, deg[100005], ans; + +int main() { + cin >> n; + for (int i = 1; i < n; i++) { + cin >> u >> v; + ans = max({ans, ++deg[u], ++deg[v]}); + } + cout << ++ans << endl; + return 0; +}