您的位置:首页 > 其它

[原博客] POJ 1704 Georgia and Bob

2014-09-07 23:52 246 查看
题目链接
题意:

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>

//by zrt
//problem:
using namespace std;
typedef long long LL;
const int inf(0x3f3f3f3f);
const double eps(1e-9);
int tt;
int a[1005];
int b[1005];
int main(){
#ifdef LOCAL
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
scanf("%d",&tt);
while(tt--){
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&a[i]);
sort(a,a+n+1);
for(int i=1;i<=n;i++) b[i]=a[i]-a[i-1]-1;
int sg=0;
for(int i=n;i>0;i-=2){
sg^=b[i];
}
if(!sg) puts("Bob will win");
else puts("Georgia will win");
}

return 0;
}


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: