当前位置:网站首页>博弈论 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");
}
}
原创不易
转载请标明出处
如果对你有所帮助 别忘啦点赞支持哈
边栏推荐
- SPI 详解
- Error ora-28547 or ora-03135 when Navicat connects to Oracle Database
- Simple selection sort of selection sort
- C Primer Plus Chapter 15 (bit operation)
- MySQL advanced part 1: View
- MatrixDB v4.5.0 重磅发布,全新推出 MARS2 存储引擎!
- 【Rust 笔记】17-并发(上)
- Leetcode backtracking method
- Daily question 1189 Maximum number of "balloons"
- 1040 Longest Symmetric String
猜你喜欢
leetcode-6111:螺旋矩阵 IV
Redis publish subscribe command line implementation
SPI 详解
Error ora-28547 or ora-03135 when Navicat connects to Oracle Database
1.15 - input and output system
Single chip computer engineering experience - layered idea
背包问题 AcWing 9. 分组背包问题
WordPress switches the page, and the domain name changes back to the IP address
Sqlmap tutorial (1)
数据可视化图表总结(二)
随机推荐
MySQL advanced part 1: stored procedures and functions
Quickly use Amazon memorydb and build your own redis memory database
NotImplementedError: Cannot convert a symbolic Tensor (yolo_boxes_0/meshgrid/Size_1:0) to a numpy ar
打印机脱机时一种容易被忽略的原因
2021apmcm post game Summary - edge detection
Appium自动化测试基础 — Appium测试环境搭建总结
【Rust 笔记】15-字符串与文本(下)
Sum of three terms (construction)
[2020]GRAF: Generative Radiance Fields for 3D-Aware Image Synthesis
leetcode-6110:网格图中递增路径的数目
1040 Longest Symmetric String
容斥原理 AcWing 890. 能被整除的数
Multi screen computer screenshots will cut off multiple screens, not only the current screen
可变电阻器概述——结构、工作和不同应用
数据可视化图表总结(二)
LeetCode 1200. Minimum absolute difference
CPU内核和逻辑处理器的区别
1039 Course List for Student
Matrixdb V4.5.0 was launched with a new mars2 storage engine!
【Rust 笔记】14-集合(上)