当前位置:网站首页>博弈论 AcWing 891. Nim游戏
博弈论 AcWing 891. Nim游戏
2022-07-27 10:35:00 【T_Y_F666】
博弈论 AcWing 891. Nim游戏
原题链接
算法标签
数学知识 博弈论 Nim游戏
思路
博弈论基本概念

结论证明

代码
#include<bits/stdc++.h>
#define int long long
#define abs fabs
#define rep(i, a, b) for(int i=a;i<b;++i)
#define Rep(i, a, b) for(int i=a;i>=b;--i)
using namespace std;
const int N = 5015;
int pr[N], st[N], s[N], cnt;
inline int read(){
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
return s*w;
}
void put(int x) {
if(x<0) putchar('-'),x=-x;
if(x>=10) put(x/10);
putchar(x%10^48);
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n=read();
int ans=0;
while(n--){
int a=read();
ans^=a;
}
if(ans){
puts("Yes");
}else{
puts("No");
}
}
原创不易
转载请标明出处
如果对你有所帮助 别忘啦点赞支持哈
边栏推荐
- 2022牛客多校训练(3)A-Ancestor 题目翻译
- MySQL installation (RPM package)
- IO流_数据输入输出流的概述和讲解
- The longest ascending subsequence model acwing 1017. The glider wing of the strange thief Kidd
- 背包模型 AcWing 1024. 装箱问题
- Influence of black and white pixel distribution on iteration times
- Students, don't copy all my code, remember to change it, or we both want G
- The longest ascending subsequence model acwing 1016. The sum of the largest ascending subsequence
- Miscellaneous records of Finance
- 推导STO双中心动能积分的详细展开式
猜你喜欢
随机推荐
IMG SRC is empty or SRC does not exist, and the picture has a white border
Yonbuilder enables innovation, and the "golden keyboard Award" of the fourth UFIDA developer competition is open!
Based on the open source stream batch integrated data synchronization engine Chunjun data restore DDL parsing module actual combat sharing
Longest ascending subsequence model acwing 1010. Interceptor missile
涌现与形态的局部差异和整体差异
发动机悬置系统冲击仿真-瞬时模态动态分析与响应谱分析
Sorry, you guys have something to deal with in the bank recently, which has been delayed
学习笔记-简易服务器实现
Learning notes - simple server implementation
7 row K with the weakest combat effectiveness in the matrix
Real time development platform construction practice, in-depth release of real-time data value - 04 live broadcast review
antd中table hover上去的背景色样式修改
NFT leaderboard -nft real offer latest address: NFT leaderboard.com
最长上升子序列模型 AcWing 1016. 最大上升子序列和
tensorflow运行报错解决方法
Application of 5g private network in smart medicine
ACM warm-up Exercise 2 in 2022 summer vacation (summary)
如何创建一个带诊断工具的.NET镜像
The influence of the number of non-zero values in the picture on Classification
学习笔记-uni-app








