#include<bits/stdc++.h>
#define N 200100
using namespace std;
int beg[N],to[N],nex[N];
int sg[N];
int len,n;
inline void Add(int a,int b){
nex[++len]=beg[a],beg[a]=len,to[len]=b;
nex[++len]=beg[b],beg[b]=len,to[len]=a;
}
void dfs(int p,int fa){
int A=0,B=0;
for(int i=beg[p];i;i=nex[i]){
if(to[i]!=fa){
dfs(to[i],p);
sg[p]^=sg[to[i]]+1;
}
}
}
int main(){
scanf("%d",&n);
for(int i=1;i<n;i++){
int a,b;
scanf("%d%d",&a,&b);
Add(a,b);
}
dfs(1,-1);
printf("%s\n",sg[1]?"Alice":"Bob");
return 0;
}
AtCoder Grand Contest 017 D - Game on Tree
最新推荐文章于 2019-12-26 09:19:48 发布