当前位置:网站首页>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
边栏推荐
- International Open Source firmware Foundation (osff) organization
- 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
- [2021]GIRAFFE: Representing Scenes as Compositional Generative Neural Feature Fields
- 4. Object mapping Mapster
- P2575 master fight
- 5.Oracle-錶空間
- New title of module a of "PanYun Cup" secondary vocational network security skills competition
- TypeScript 基础讲解
- Leetcode-3: Longest substring without repeated characters
- [BMZCTF-pwn] ectf-2014 seddit
猜你喜欢
ollvm编译出现的问题纪录
MySQL advanced part 2: MySQL architecture
3. Oracle control file management
Alibaba established the enterprise digital intelligence service company "Lingyang" to focus on enterprise digital growth
MySQL怎么运行的系列(八)14张图说明白MySQL事务原子性和undo日志原理
LeetCode 0108. Convert an ordered array into a binary search tree - the median of the array is the root, and the left and right of the median are the left and right subtrees respectively
MySQL advanced part 1: stored procedures and functions
International Open Source firmware Foundation (osff) organization
5. Oracle TABLESPACE
4. 对象映射 - Mapping.Mapster
随机推荐
MPLS experiment
[rust notes] 16 input and output (Part 1)
MatrixDB v4.5.0 重磅发布,全新推出 MARS2 存储引擎!
传统数据库逐渐“难适应”,云原生数据库脱颖而出
Leetcode stack related
Bash exercise 17 writing scripts to install the server side of FRP reverse proxy software
Network security skills competition in Secondary Vocational Schools -- a tutorial article on middleware penetration testing in Guangxi regional competition
5.Oracle-錶空間
Gauss Cancellation acwing 884. Solution d'un système d'équations Xor linéaires par élimination gaussienne
【LeetCode】Day95-有效的数独&矩阵置零
MySQL advanced part 1: triggers
C Primer Plus Chapter 15 (bit operation)
Redis-01.初识Redis
Doing SQL performance optimization is really eye-catching
高斯消元 AcWing 884. 高斯消元解异或线性方程组
[BMZCTF-pwn] ectf-2014 seddit
Winter messenger 2
[wustctf2020] plain_ WP
Leetcode dynamic programming
快速使用Amazon MemoryDB并构建你专属的Redis内存数据库