You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
978 B
37 lines
978 B
#include <iostream>
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
#include <vector>
|
|
#include <map>
|
|
#include <queue>
|
|
#include <algorithm>
|
|
#include <math.h>
|
|
#include <cstdio>
|
|
|
|
const int N = 1010;
|
|
using namespace std;
|
|
int T, a[N];
|
|
int main() {
|
|
scanf("%d", &T);
|
|
while (T--) {
|
|
int n, res = 0;
|
|
|
|
scanf("%d", &n);
|
|
|
|
//要明确在a[i]中装的内容是放置棋子的格式号!
|
|
for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
|
|
|
|
//把棋子按位置升序排列(因为有可能他给你的就是没有顺序的)
|
|
sort(a + 1, a + n + 1);
|
|
|
|
//从后向前,两两一组
|
|
for (int i = n; i > 0; i = i - 2)
|
|
res ^= (a[i] - a[i - 1] - 1); // a[i] - a[i - 1] - 1 表示两个棋子之间的空格数量,理解为石子数
|
|
|
|
if (res)
|
|
puts("Georgia will win"); //先手必胜
|
|
else
|
|
puts("Bob will win"); //先手必败
|
|
}
|
|
return 0;
|
|
} |