Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include<bits/stdc++.h>using namespace std;struct node{int n;struct node* next;node(int x, struct node* y) {n=x;next=y;};node() {n=0;next=NULL;}}tree[100010];int N,res;int walk(int x,int fa){int i,k,nn=1;struct node* temp=tree[x].next;while(temp!=NULL) {if(temp->n!=fa){k=walk(temp->n,x);if(k%2==0)res++;nn+=k;}temp=temp->next;}return nn;}int main()