题目传送门:http://poj.org/problem?id=1704
模板题~
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
const int MAXN=1005;
int a[MAXN];
int num;
using namespace std;
void solve()
{
if(num%2==1)
a[num++]=0;
sort(a,a+num);
int x=0;
for(int i=0;i+1<num;i+=2)
{
x^=(a[i+1]-a[i]-1);
}
if(x==0)
{
printf("Bob will win\n");
}
else
{
printf("Georgia will win\n");
}
return ;
}
int main (void)
{
int t;
cin>>t;
while(t--)
{
scanf("%d",&num);
for(int i=0;i<num;i++)
{
scanf("%d",&a[i]);
}
solve();
}
return 0;
}