POJ2234 Matches Game(尼姆博弈)

题目链接

裸的尼姆博弈。。。

#include<cstring>
#include<cstdio>
#include<cstring>
#include<cmath>
#include <vector>
#include<string>
#include<iostream>
#include<algorithm>
using namespace std;
int a[25];
int main(){
    //freopen("a.txt", "r", stdin);
    int n;
    while(cin >> n && n){
        int sum = 0;
        for(int i = 0; i < n; i++){
            scanf("%d", &a[i]);
            sum ^= a[i];
        }
        if(!sum) cout << "No" << endl;
        else
            cout << "Yes" << endl;
    }

    return 0;
}
Zhao Li /
Published under (CC) BY-NC-SA in categories 算法  tagged with 博弈  尼姆博弈