POJ2234 xingxing在努力 博弈论 NIM

  NIM博弈, 具体证明敬请期待。。。。。

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

using namespace std;

int main()
{
    int n;
    while(scanf("%d", &n) == 1)
    {
        int ans;
        scanf("%d", &ans);
        n--;
        while(n--)
        {
            int t;
            scanf("%d", &t);
            ans ^= t;
        }
        if(ans) printf("Yes\n");
        else printf("No\n");
    }
    return 0;
}

 

  

posted @ 2015-11-02 15:58  xing-xing  阅读(90)  评论(0)    收藏  举报