当前位置:网站首页>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 
边栏推荐
- Install opencv -- CONDA to establish a virtual environment and add the kernel of this environment in jupyter
- [learning] database: MySQL query conditions have functions that lead to index failure. Establish functional indexes
- Daily question 1189 Maximum number of "balloons"
- Single chip computer engineering experience - layered idea
- Chart. JS - Format Y axis - chart js - Formatting Y axis
- 求组合数 AcWing 888. 求组合数 IV
- Presentation of attribute value of an item
- 博弈论 AcWing 892. 台阶-Nim游戏
- 在新线程中使用Handler
- MySQL advanced part 2: the use of indexes
猜你喜欢
随机推荐
Redis-01.初识Redis
Paper reading report
Liunx starts redis
Quickly use Amazon memorydb and build your own redis memory database
Nested method, calculation attribute is not applicable, use methods
Regulations for network security events of vocational group in 2022 Guizhou Vocational College skill competition
Leetcode divide and conquer / dichotomy
[leetcode] day94 reshape matrix
Is it impossible for lamda to wake up?
Winter messenger 2
MySQL advanced part 2: SQL optimization
Real time clock (RTC)
在新线程中使用Handler
Leetcode-22: bracket generation
Sword finger offer II 058: schedule
Currently clicked button and current mouse coordinates in QT judgment interface
In depth analysis of for (VaR I = 0; I < 5; i++) {settimeout (() => console.log (I), 1000)}
Error ora-28547 or ora-03135 when Navicat connects to Oracle Database
Gaussian elimination acwing 884 Gauss elimination for solving XOR linear equations
【LeetCode】Easy | 20. Valid parentheses








