제출 #1336473

#제출 시각아이디문제언어결과실행 시간메모리
1336473haught_veathNetwork (BOI15_net)C++20
0 / 100
0 ms344 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) x.begin(),x.end()
#define fileinp(name) freopen(name,"r",stdin)
#define fileout(name) freopen(name,"w",stdout)
#define loop(i, start, end, step) for (long long i = start; i <=end; i += step)
#define rloop(i,start,end,step) for(long long i = end; i>=start;i-=step)
#define fastio ios_base::sync_with_stdio(false);cout.tie(0);cin.tie(0)
#define ins push_back
template <typename T>
using v = vector<T>;
using cap = pair<long,long>;

v<v<int>> adj;
int cnt = 0;
signed main(){
  int n;
  cin >> n;
  adj.resize(n+1);
  loop(i,1,n-1,1){
    int a,b;
    cin >> a >> b;
    adj[a].ins(b);
    adj[b].ins(a);
  }
  loop(i,1,n,1)if(adj[i].size() == 1)cnt++;
  cout << (cnt+(cnt&1))/2;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...