AcWing 891. Nim游戏(裸题)

题目链接:点击这里

在这里插入图片描述

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

using namespace std;

int main()
{
    int n, res = 0;
    scanf("%d", &n);
    
    while(n--)
    {
        int x;
        scanf("%d", &x);
        res ^= x;
    }
    
    if(res != 0)    puts("Yes");
    else    puts("No");
    
    return 0;
}
发布了811 篇原创文章 · 获赞 127 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/qq_42815188/article/details/104842783