当前位置:网站首页>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 
边栏推荐
- [wustctf2020] plain_ WP
- Paper reading report
- 20220213-CTF MISC-a_ good_ Idea (use of stegsolve tool) -2017_ Dating_ in_ Singapore
- How to set the drop-down arrow in the spinner- How to set dropdown arrow in spinner?
- June 29, 2022 daily
- [rust notes] 16 input and output (Part 2)
- Open source storage is so popular, why do we insist on self-development?
- 5. Oracle TABLESPACE
- Chart. JS - Format Y axis - chart js - Formatting Y axis
- MySQL advanced part 1: View
猜你喜欢

求组合数 AcWing 887. 求组合数 III

Traditional databases are gradually "difficult to adapt", and cloud native databases stand out

【LeetCode】Easy | 20. Valid parentheses

3. Oracle control file management

Alibaba's new member "Lingyang" officially appeared, led by Peng Xinyu, Alibaba's vice president, and assembled a number of core department technical teams

1.14 - assembly line

MPLS experiment

区间问题 AcWing 906. 区间分组

Gaussian elimination acwing 884 Gauss elimination for solving XOR linear equations

MySQL advanced part 2: MySQL architecture
随机推荐
LeetCode 0107. Sequence traversal of binary tree II - another method
[learning] database: MySQL query conditions have functions that lead to index failure. Establish functional indexes
Traversal of leetcode tree
Leetcode-3: Longest substring without repeated characters
__ builtin_ Popcount() counts the number of 1s, which are commonly used in bit operations
Basic explanation of typescript
3.Oracle-控制文件的管理
Ffmpeg build download (including old version)
New title of module a of "PanYun Cup" secondary vocational network security skills competition
MySQL advanced part 2: the use of indexes
Leetcode-556: the next larger element III
Currently clicked button and current mouse coordinates in QT judgment interface
WordPress switches the page, and the domain name changes back to the IP address
MySQL advanced part 1: index
ollvm编译出现的问题纪录
5. Oracle tablespace
Navicat连接Oracle数据库报错ORA-28547或ORA-03135
高斯消元 AcWing 884. 高斯消元解异或线性方程组
Sqlmap tutorial (1)
C job interview - casting and comparing - C job interview - casting and comparing