当前位置:网站首页>Game theory acwing 892 Steps Nim game
Game theory acwing 892 Steps Nim game
2022-07-05 06:24:00 【T_ Y_ F666】
Game theory AcWing 892. steps -Nim game
Original link
Algorithm tags
Math knowledge Game theory Nim game
Ideas

Code
#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");
}
}
Originality is not easy.
Reprint please indicate the source
If it helps you Don't forget to praise and support 
边栏推荐
- 什么是套接字?Socket基本介绍
- June 29, 2022 daily
- __ builtin_ Popcount() counts the number of 1s, which are commonly used in bit operations
- 4. 对象映射 - Mapping.Mapster
- 1.13 - RISC/CISC
- 5.Oracle-錶空間
- SQL三种连接:内连接、外连接、交叉连接
- MySQL advanced part 1: triggers
- WordPress switches the page, and the domain name changes back to the IP address
- FFmpeg build下载(包含old version)
猜你喜欢

Gaussian elimination acwing 884 Gauss elimination for solving XOR linear equations

区间问题 AcWing 906. 区间分组

MPLS experiment

Leetcode-6108: decrypt messages
![[2021]GIRAFFE: Representing Scenes as Compositional Generative Neural Feature Fields](/img/65/7fa32cd0005ddaaebacd85c25e0c7e.jpg)
[2021]GIRAFFE: Representing Scenes as Compositional Generative Neural Feature Fields

阿里新成员「瓴羊」正式亮相,由阿里副总裁朋新宇带队,集结多个核心部门技术团队

Leetcode stack related

Bit of MySQL_ OR、BIT_ Count function

4.Oracle-重做日志文件管理

1.手动创建Oracle数据库
随机推荐
Traversal of leetcode tree
RecyclerView的应用
3.Oracle-控制文件的管理
[leetcode] day95 effective Sudoku & matrix zeroing
4. Object mapping Mapster
Paper reading report
求组合数 AcWing 889. 满足条件的01序列
P3265 [jloi2015] equipment purchase
Leetcode-6110: number of incremental paths in the grid graph
2022/6/29-日报
5.Oracle-錶空間
[2020]GRAF: Generative Radiance Fields for 3D-Aware Image Synthesis
SQL三种连接:内连接、外连接、交叉连接
Alibaba established the enterprise digital intelligence service company "Lingyang" to focus on enterprise digital growth
区间问题 AcWing 906. 区间分组
2021apmcm post game Summary - edge detection
Doing SQL performance optimization is really eye-catching
Suppose a bank's ATM machine, which allows users to deposit and withdraw money. Now there is 200 yuan in an account, and both user a and user B have the right to deposit and withdraw money from this a
博弈论 AcWing 893. 集合-Nim游戏
Shutter web hardware keyboard monitoring