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:
parent
6b12610d5c
commit
d3612e16ac
15
Luogu/problem/P5197/P5197.cpp
Normal file
15
Luogu/problem/P5197/P5197.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user