0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 18:52:02 +00:00

P5197 [USACO19JAN]Grass Planting S

R52404968
This commit is contained in:
Baoshuo Ren 2021-07-05 08:29:30 +08:00 committed by Baoshuo Ren
parent 6b12610d5c
commit d3612e16ac
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

View File

@ -0,0 +1,15 @@
#include <bits/stdc++.h>
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;
}