17 Mar 2013

Logging Game_SOLVED


/*

CODECHEF
PROBLEM CODE : LOGGERS

*/

#include<stdio.h>
 
 
int sgtable[251]={-1,0,1,2,3,1,4,3,2,1,4,2,6,4,1,2,7,1,4,3,2,1,4,6,7
,4,1,2,8,5,4,7,2,1,8,6,7,4,1,2,3,1,4,7,2,1,8,2,7,4,1,2,8,1,4,7,2,1,
4,2,7,4,1,2,8,1,4,7,2,1,8,6,7,4,1,2,8,1,4,7,2,1,8,2,7,4,1,2,8,1,4,7,2,1,8,2,7,4,1,2,
8,1,4,7,2,1,8,2,7,4,1,2,8,1,4,7,2,1,8,2,7,4,1,2,8,1,4,7,2,1,8,2,7
,4,1,2,8,1,4,7,2,1,8,2,7,4,1,2,8,1,4,7,2,1,8,2,7,4,1,2,8,1,4,7,2,1,
8,2,7,4,1,2,8,1,4,7,2,1,8,2,7,4,1,2,8,1,4,7,2,1,8,2,7,4,1
,2,8,1,4,7,2,1,8,2,7,4,1,2,8,1,4,7,2,1,8,2,7,4,1,2,8,1,4
,7,2,1,8,2,7,4,1,2,8,1,4,7,2,1,8,2,7,4,1,2,8,1,4,7,2,1,8};
 
int main()
{
 
int t;
scanf("%d",&t);
while(t--)
{
int n;
scanf("%d",&n);
int i,val,ans=0;
for(i=0;i<n;i++)
{
scanf("%d",&val);;
ans=ans^sgtable[val];
}
if(ans)printf("Alice\n");
else printf("Bob\n");
}
return 0;
}

Categories: , , ,

0 comments:

Post a Comment

Copyright © UPgradeCODING | Powered by Blogger