当前位置:网站首页>博弈论 AcWing 891. Nim游戏
博弈论 AcWing 891. Nim游戏
2022-07-05 06:16: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");
}
}
原创不易
转载请标明出处
如果对你有所帮助 别忘啦点赞支持哈
边栏推荐
- Daily question 1189 Maximum number of "balloons"
- Overview of variable resistors - structure, operation and different applications
- SPI details
- Collection: programming related websites and books
- 一些工具的记录2022
- Simple selection sort of selection sort
- Sum of three terms (construction)
- MySQL advanced part 1: index
- Matrixdb V4.5.0 was launched with a new mars2 storage engine!
- 阿里新成员「瓴羊」正式亮相,由阿里副总裁朋新宇带队,集结多个核心部门技术团队
猜你喜欢
Navicat连接Oracle数据库报错ORA-28547或ORA-03135
SQLMAP使用教程(一)
MySQL怎么运行的系列(八)14张图说明白MySQL事务原子性和undo日志原理
MySQL advanced part 1: View
1.14 - 流水线
leetcode-6110:网格图中递增路径的数目
Redis publish subscribe command line implementation
Data visualization chart summary (II)
阿里巴巴成立企业数智服务公司“瓴羊”,聚焦企业数字化增长
Sqlmap tutorial (II) practical skills I
随机推荐
[rust notes] 15 string and text (Part 1)
leetcode-6109:知道秘密的人数
JS quickly converts JSON data into URL parameters
【Rust 笔记】17-并发(下)
【LeetCode】Day94-重塑矩阵
【Rust 笔记】16-输入与输出(上)
Is it impossible for lamda to wake up?
LaMDA 不可能觉醒吗?
Leetcode-6108: decrypt messages
对for(var i = 0;i < 5;i++) {setTimeout(() => console.log(i),1000)}的深入分析
TypeScript 基础讲解
高斯消元 AcWing 884. 高斯消元解异或线性方程组
QQ computer version cancels escape character input expression
[rust notes] 17 concurrent (Part 2)
1.15 - input and output system
Currently clicked button and current mouse coordinates in QT judgment interface
MySQL advanced part 2: the use of indexes
Leetcode-6111: spiral matrix IV
LeetCode 0108.将有序数组转换为二叉搜索树 - 数组中值为根,中值左右分别为左右子树
Golang uses context gracefully