当前位置:网站首页>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
边栏推荐
- 如何正确在CSDN问答进行提问
- Leetcode-31: next spread
- 2021apmcm post game Summary - edge detection
- ADG5412FBRUZ-RL7应用 双电源模拟开关和多路复用器IC
- JS quickly converts JSON data into URL parameters
- International Open Source firmware Foundation (osff) organization
- MySQL advanced part 1: triggers
- 什么是套接字?Socket基本介绍
- Filter the numbers and pick out even numbers from several numbers
- Leetcode-6110: number of incremental paths in the grid graph
猜你喜欢
MySQL advanced part 2: the use of indexes
Liunx starts redis
Quickly use Amazon memorydb and build your own redis memory database
中国剩余定理 AcWing 204. 表达整数的奇怪方式
[2020]GRAF: Generative Radiance Fields for 3D-Aware Image Synthesis
Alibaba's new member "Lingyang" officially appeared, led by Peng Xinyu, Alibaba's vice president, and assembled a number of core department technical teams
There are three kinds of SQL connections: internal connection, external connection and cross connection
Chapter 6 relational database theory
Bash exercise 17 writing scripts to install the server side of FRP reverse proxy software
Gaussian elimination acwing 884 Gauss elimination for solving XOR linear equations
随机推荐
MatrixDB v4.5.0 重磅发布,全新推出 MARS2 存储引擎!
5. Oracle TABLESPACE
Leetcode array operation
2.Oracle-数据文件的添加及管理
Alibaba established the enterprise digital intelligence service company "Lingyang" to focus on enterprise digital growth
How to set the drop-down arrow in the spinner- How to set dropdown arrow in spinner?
How to make water ripple effect? This wave of water ripple effect pulls full of retro feeling
Usage scenarios of golang context
Sorting out the latest Android interview points in 2022 to help you easily win the offer - attached is the summary of Android intermediate and advanced interview questions in 2022
高斯消元 AcWing 884. 高斯消元解异或線性方程組
Sword finger offer II 058: schedule
What's wrong with this paragraph that doesn't work? (unresolved)
4. 对象映射 - Mapping.Mapster
快速使用Amazon MemoryDB并构建你专属的Redis内存数据库
[leetcode] day95 effective Sudoku & matrix zeroing
Basic explanation of typescript
容斥原理 AcWing 890. 能被整除的数
C Primer Plus Chapter 15 (bit operation)
1.14 - assembly line
2022-5-第四周日报