View Code of Problem 122

#include<stdio.h>
int main(){
	int t,n,i,j,k,count;
	while(scanf("%d",&t)!=EOF){
		while(t--)
		{
		count=0;
			scanf("%d",&n);
			int a[n-1][2];
			for(i=0;i<n-1;i++){
				for(j=0;j<2;j++)
				scanf("%d",&a[i][j]);
			}
			for(i=0;i<n-1;i++)
			if(a[i][0]==1)
			{
		count++;
		}
	if(count%2==0)
	printf("Bob\n");
	else
	printf("Alice\n");
}
}
} 

Double click to view unformatted code.


Back to problem 122