当前位置:网站首页>博弈论 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");
}
}
原创不易
转载请标明出处
如果对你有所帮助 别忘啦点赞支持哈
边栏推荐
- NotImplementedError: Cannot convert a symbolic Tensor (yolo_boxes_0/meshgrid/Size_1:0) to a numpy ar
- Record the process of configuring nccl and horovod in these two days (original)
- 实时时钟 (RTC)
- Leetcode-6110: number of incremental paths in the grid graph
- 【Rust 笔记】15-字符串与文本(上)
- Redis publish subscribe command line implementation
- LeetCode 1200. Minimum absolute difference
- [rust notes] 16 input and output (Part 2)
- 【Rust 笔记】16-输入与输出(上)
- MySQL advanced part 2: storage engine
猜你喜欢

高斯消元 AcWing 884. 高斯消元解异或线性方程组

Chapter 6 relational database theory

2021apmcm post game Summary - edge detection
![Introduction to LVS [unfinished (semi-finished products)]](/img/72/d5a943a8d6d71823dcbd7f23dda35b.png)
Introduction to LVS [unfinished (semi-finished products)]

NotImplementedError: Cannot convert a symbolic Tensor (yolo_boxes_0/meshgrid/Size_1:0) to a numpy ar

Appium automation test foundation - Summary of appium test environment construction

Doing SQL performance optimization is really eye-catching

Navicat連接Oracle數據庫報錯ORA-28547或ORA-03135

4. Object mapping Mapster

leetcode-6110:网格图中递增路径的数目
随机推荐
Daily question 1984 Minimum difference in student scores
阿里巴巴成立企业数智服务公司“瓴羊”,聚焦企业数字化增长
Niu Mei's math problems
什么是套接字?Socket基本介绍
1.14 - 流水线
leetcode-6111:螺旋矩阵 IV
Network security skills competition in Secondary Vocational Schools -- a tutorial article on middleware penetration testing in Guangxi regional competition
The difference between CPU core and logical processor
Leetcode-1200: minimum absolute difference
Sword finger offer II 058: schedule
[rust notes] 17 concurrent (Part 1)
[rust notes] 14 set (Part 1)
Multi screen computer screenshots will cut off multiple screens, not only the current screen
Appium自动化测试基础 — Appium测试环境搭建总结
1040 Longest Symmetric String
leetcode-6109:知道秘密的人数
How to understand the definition of sequence limit?
[rust notes] 14 set (Part 2)
Flutter Web 硬件键盘监听
New title of module a of "PanYun Cup" secondary vocational network security skills competition