当前位置:网站首页>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
边栏推荐
- Sum of three terms (construction)
- Presentation of attribute value of an item
- 11-gorm-v2-03-basic query
- Sqlmap tutorial (II) practical skills I
- 2021apmcm post game Summary - edge detection
- FFmpeg build下载(包含old version)
- 1.14 - assembly line
- How to set the drop-down arrow in the spinner- How to set dropdown arrow in spinner?
- Quickly use Amazon memorydb and build your own redis memory database
- our solution
猜你喜欢
Error ora-28547 or ora-03135 when Navicat connects to Oracle Database
容斥原理 AcWing 890. 能被整除的数
【LeetCode】Easy | 20. Valid parentheses
WordPress switches the page, and the domain name changes back to the IP address
Leetcode-6111: spiral matrix IV
1.15 - input and output system
LeetCode 0107. Sequence traversal of binary tree II - another method
博弈论 AcWing 892. 台阶-Nim游戏
Bit of MySQL_ OR、BIT_ Count function
阿里巴巴成立企业数智服务公司“瓴羊”,聚焦企业数字化增长
随机推荐
2022-5-第四周日报
7.Oracle-表结构
传统数据库逐渐“难适应”,云原生数据库脱颖而出
Matrixdb V4.5.0 was launched with a new mars2 storage engine!
Leetcode backtracking method
4. Object mapping Mapster
Niu Mei's math problems
Leetcode-22: bracket generation
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
C Primer Plus Chapter 15 (bit operation)
Error ora-28547 or ora-03135 when Navicat connects to Oracle Database
Chart. JS - Format Y axis - chart js - Formatting Y axis
在新线程中使用Handler
博弈论 AcWing 892. 台阶-Nim游戏
Chapter 6 relational database theory
高斯消元 AcWing 884. 高斯消元解异或線性方程組
LeetCode 0107. Sequence traversal of binary tree II - another method
Erreur de connexion Navicat à la base de données Oracle Ora - 28547 ou Ora - 03135
Leetcode-556: the next larger element III
[learning] database: several cases of index failure