当前位置:网站首页>博弈论 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");
}
}
原创不易
转载请标明出处
如果对你有所帮助 别忘啦点赞支持哈
边栏推荐
- Filter the numbers and pick out even numbers from several numbers
- TypeScript 基础讲解
- Leetcode-31: next spread
- 【Rust 笔记】17-并发(下)
- Leetcode-6109: number of people who know secrets
- leetcode-6110:网格图中递增路径的数目
- Sword finger offer II 058: schedule
- MySQL advanced part 2: MySQL architecture
- Leetcode-1200: minimum absolute difference
- SQLMAP使用教程(二)实战技巧一
猜你喜欢

Sqlmap tutorial (II) practical skills I

Erreur de connexion Navicat à la base de données Oracle Ora - 28547 ou Ora - 03135

数据可视化图表总结(一)

Quickly use Amazon memorydb and build your own redis memory database

Simple selection sort of selection sort

什么是套接字?Socket基本介绍

4. 对象映射 - Mapping.Mapster

leetcode-6108:解密消息

MySQL advanced part 1: index

Arduino 控制的 RGB LED 无限镜
随机推荐
Leetcode-9: palindromes
数据可视化图表总结(一)
Multi screen computer screenshots will cut off multiple screens, not only the current screen
【Rust 笔记】16-输入与输出(上)
Winter vacation water test 1 Summary
博弈论 AcWing 891. Nim游戏
MySQL advanced part 1: triggers
4. Object mapping Mapster
1041 Be Unique
Erreur de connexion Navicat à la base de données Oracle Ora - 28547 ou Ora - 03135
Appium基础 — 使用Appium的第一个Demo
2021apmcm post game Summary - edge detection
Shutter web hardware keyboard monitoring
MatrixDB v4.5.0 重磅发布,全新推出 MARS2 存储引擎!
Règlement sur la sécurité des réseaux dans les écoles professionnelles secondaires du concours de compétences des écoles professionnelles de la province de Guizhou en 2022
Traditional databases are gradually "difficult to adapt", and cloud native databases stand out
【Rust 笔记】17-并发(上)
Sum of three terms (construction)
leetcode-556:下一个更大元素 III
SQL三种连接:内连接、外连接、交叉连接