当前位置:网站首页>博弈论 AcWing 892. 台阶-Nim游戏
博弈论 AcWing 892. 台阶-Nim游戏
2022-07-05 06:16:00 【T_Y_F666】
博弈论 AcWing 892. 台阶-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 = 100005;
int a[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;
rep(i, 0, n){
a[i]=read();
if(!(i%2)){
ans^=a[i];
}
}
if(ans){
puts("Yes");
}else{
puts("No");
}
}
原创不易
转载请标明出处
如果对你有所帮助 别忘啦点赞支持哈
边栏推荐
- 多屏电脑截屏会把多屏连着截下来,而不是只截当前屏
- leetcode-31:下一个排列
- 4. 对象映射 - Mapping.Mapster
- LeetCode 0108. Convert an ordered array into a binary search tree - the median of the array is the root, and the left and right of the median are the left and right subtrees respectively
- Matrixdb V4.5.0 was launched with a new mars2 storage engine!
- LeetCode-61
- 【Rust 笔记】15-字符串与文本(上)
- Winter vacation water test 1 Summary
- 数据可视化图表总结(一)
- A reason that is easy to be ignored when the printer is offline
猜你喜欢
Leetcode-6111: spiral matrix IV
QQ电脑版取消转义符输入表情
Operator priority, one catch, no doubt
Data visualization chart summary (II)
Erreur de connexion Navicat à la base de données Oracle Ora - 28547 ou Ora - 03135
Appium基础 — 使用Appium的第一个Demo
Quickly use Amazon memorydb and build your own redis memory database
MySQL怎么运行的系列(八)14张图说明白MySQL事务原子性和undo日志原理
[2021]IBRNet: Learning Multi-View Image-Based Rendering Qianqian
4. 对象映射 - Mapping.Mapster
随机推荐
Niu Mei's math problems
Sqlmap tutorial (1)
Usage scenarios of golang context
[rust notes] 13 iterator (Part 2)
What's wrong with this paragraph that doesn't work? (unresolved)
【Rust 笔记】17-并发(下)
How to understand the definition of sequence limit?
4. 对象映射 - Mapping.Mapster
Appium automation test foundation - Summary of appium test environment construction
Operator priority, one catch, no doubt
Leetcode-22: bracket generation
liunx启动redis
Single chip computer engineering experience - layered idea
Quickly use Amazon memorydb and build your own redis memory database
[2021]IBRNet: Learning Multi-View Image-Based Rendering Qianqian
Groupbykey() and reducebykey() and combinebykey() in spark
LeetCode 0107. Sequence traversal of binary tree II - another method
JS quickly converts JSON data into URL parameters
Real time clock (RTC)
[2021]GIRAFFE: Representing Scenes as Compositional Generative Neural Feature Fields