poj1704

来源:互联网 发布:机械制图软件手机版 编辑:程序博客网 时间:2024/06/08 07:03
#include <iostream>#include <algorithm>using namespace std;#define oo (~0U >> 1)#define MAXN 1000 + 10int temp[MAXN];int node[MAXN];void input(){    int n, t, x;    cin >> t;    while (t--)    {        int sum = 0;        cin >> n;        for (int i = 1; i <= n; i++)        {            cin >> temp[i];        }        sort(temp + 1, temp + n + 1);        for (int i = 1; i <= n; i++)        {            node[i] = temp[i] - temp[i - 1] - 1;        }        for (int i = n; i >= 1; i -= 2)        {            sum ^= node[i];        }        cout << (!sum ? ("Bob will win") : ("Georgia will win")) << endl;    }}int main(){    input();    return 0;}

原创粉丝点击