当前位置:网站首页>Game theory acwing 891. Nim game
Game theory acwing 891. Nim game
2022-07-27 11:19:00 【T_ Y_ F666】
Game theory AcWing 891. Nim game
Original link
Algorithm tags
Math knowledge Game theory Nim game
Ideas
Basic concepts of game theory 

The conclusion proves that

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 = 5015;
int pr[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;
while(n--){
int a=read();
ans^=a;
}
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 
边栏推荐
- 2022 Niuke multi school (3) j.journey
- 349 sum of intersection of two arrays and 01
- Thank you for your likes and attention
- Solve importerror: cannot import name'abs'import tensorflow error
- Today's code farmer girl learned notes about event operation and ref attribute, and did the practice of form two-way binding
- 2022 Niuke multi school training (3) a-ancestor topic translation
- Lazy loading of lists and pictures
- Openatom openharmony sub forum, see you today at 14:00! Wonderful release of memorabilia attached
- The influence of the number of non-zero values in the picture on Classification
- 2022牛客多校 (3)J.Journey
猜你喜欢

Wenzhou University X kangaroo cloud: how to "know well" in the construction of higher talent education

Longest ascending subsequence model acwing 1012. Sister Cities

Antd table+checkbox default value display

Asustek unparalleled, this may be the best affordable high brush thin notebook on the screen

Kangaroo cloud stack based on CBO in spark SQL optimization

最长上升子序列模型 AcWing 1010. 拦截导弹

The difference of iteration number and information entropy

2022 Niuke multi school (3) j.journey

Introduction to software vulnerability analysis (I)

【着色器实现Shake随机摇动效果_Shader效果第十篇】
随机推荐
49 letter ectopic grouping and 242 effective letter ectopic words
区间问题 AcWing 906. 区间分组
Play with the cluster configuration center and learn about the Taier console
SQL Server2000 database error
求组合数 AcWing 889. 满足条件的01序列
数字三角形模型 AcWing 1015. 摘花生
Yiwen counts NFT projects valued at more than US $100million
7 row K with the weakest combat effectiveness in the matrix
[shader realizes shake random shaking effect _shader effect Chapter 10]
The longest ascending subsequence model acwing 1016. The sum of the largest ascending subsequence
最长上升子序列模型 AcWing 482. 合唱队形
IO流_字符流、IO流小结、IO流案例总结
4 search insertion location
背包模型 AcWing 1024. 装箱问题
泰山OFFICE技术讲座:缩放比例与打开文件
ethereum rpc
博弈论 AcWing 893. 集合-Nim游戏
洛谷P1441 砝码称重
栈 AcWing 3302. 表达式求值
TensorFlow张量运算函数集