1982: [Spoj 2021]Moving Pebbles Time Limit: 10 Sec Memory Limit: 64 MBSubmit: 130 Solved: 88[Submit][Status][Discuss] Description 2021. Moving Pebbles Two players play the following game. At the beginning of the game they start with n (1<=n<=10000…
题目 Moving Pebbles Two players play the following game. At the beginning of the game they start with n (1<=n<=100000) piles of stones. At each step of the game, the player chooses a pile and remove at least one stone from this pile and move zero or m…
必败状态是n为偶数并且数量相同的石子堆可以两两配对,因为这样后手可以模仿先手操作 其他状态一定可以由先手给后手一步拼出一个必败状态(用最大堆补) #include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int N=100005; int n,a[N],ok=1; int read() { int r=0,f=1; char p=getchar(); while(…
这道题在论文里看到过,直接放论文原文吧 在BZOJ上是单组数据,而且数据范围符合,直接int读入排序就行了.代码: #include <cstdio> #include <algorithm> using namespace std; const int MAXN = 100005; int n, a[MAXN]; int main () { scanf("%d", &n); for(int i = 1; i <= n; ++i) scanf(&q…