当前位置:网站首页>博弈论 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");
}
}
原创不易
转载请标明出处
如果对你有所帮助 别忘啦点赞支持哈
边栏推荐
猜你喜欢
背包问题 AcWing 9. 分组背包问题
QQ computer version cancels escape character input expression
2021apmcm post game Summary - edge detection
Traditional databases are gradually "difficult to adapt", and cloud native databases stand out
【LeetCode】Easy | 20. Valid parentheses
开源存储这么香,为何我们还要坚持自研?
Network security skills competition in Secondary Vocational Schools -- a tutorial article on middleware penetration testing in Guangxi regional competition
1.13 - RISC/CISC
LVS简介【暂未完成(半成品)】
什么是套接字?Socket基本介绍
随机推荐
Presentation of attribute value of an item
Golang uses context gracefully
阿里新成员「瓴羊」正式亮相,由阿里副总裁朋新宇带队,集结多个核心部门技术团队
Records of some tools 2022
SPI 详解
SQLMAP使用教程(二)实战技巧一
Erreur de connexion Navicat à la base de données Oracle Ora - 28547 ou Ora - 03135
A reason that is easy to be ignored when the printer is offline
Is it impossible for lamda to wake up?
Appium自动化测试基础 — Appium测试环境搭建总结
[rust notes] 16 input and output (Part 2)
MySQL advanced part 1: stored procedures and functions
1041 Be Unique
MySQL advanced part 1: index
1.14 - assembly line
Shutter web hardware keyboard monitoring
【LeetCode】Day94-重塑矩阵
【Rust 笔记】13-迭代器(中)
[2020]GRAF: Generative Radiance Fields for 3D-Aware Image Synthesis
数据可视化图表总结(一)