当前位置:网站首页>Game theory acwing 891 Nim games
Game theory acwing 891 Nim games
2022-07-05 06:24: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
边栏推荐
- 容斥原理 AcWing 890. 能被整除的数
- New title of module a of "PanYun Cup" secondary vocational network security skills competition
- 阿里巴巴成立企业数智服务公司“瓴羊”,聚焦企业数字化增长
- 2048 project realization
- MySQL advanced part 2: optimizing SQL steps
- MySQL advanced part 1: View
- Leetcode backtracking method
- Bit of MySQL_ OR、BIT_ Count function
- 高斯消元 AcWing 884. 高斯消元解异或線性方程組
- 求组合数 AcWing 889. 满足条件的01序列
猜你喜欢
WordPress switches the page, and the domain name changes back to the IP address
Sqlmap tutorial (1)
背包问题 AcWing 9. 分组背包问题
1.15 - input and output system
4. Oracle redo log file management
Client use of Argo CD installation
SQL三种连接:内连接、外连接、交叉连接
Leetcode-6111: spiral matrix IV
博弈论 AcWing 892. 台阶-Nim游戏
2021apmcm post game Summary - edge detection
随机推荐
博弈论 AcWing 892. 台阶-Nim游戏
WordPress switches the page, and the domain name changes back to the IP address
MySQL advanced part 2: MySQL architecture
our solution
LeetCode-61
How to understand the definition of sequence limit?
【LeetCode】Day95-有效的数独&矩阵置零
What is socket? Basic introduction to socket
New title of module a of "PanYun Cup" secondary vocational network security skills competition
高斯消元 AcWing 884. 高斯消元解异或線性方程組
[leetcode] day95 effective Sudoku & matrix zeroing
TypeScript 基础讲解
Presentation of attribute value of an item
Quickly use Amazon memorydb and build your own redis memory database
栈 AcWing 3302. 表达式求值
Redis publish subscribe command line implementation
Regulations for network security events of vocational group in 2022 Guizhou Vocational College skill competition
C Primer Plus Chapter 15 (bit operation)
SQL三种连接:内连接、外连接、交叉连接
Leetcode-6111: spiral matrix IV