POJ 1740 A New Stone Game
2012-12-31 11:05
211 查看
题意:有n堆石子,Alice and Bob一次可以任意选择一个堆,拿走至少一个石子。然后从这堆中选任意多个石子到其他的任意堆。拿走最后一个石子的人胜利。
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <queue> #include <cmath> #include <stack> #include <map> using namespace std; int n,re[19]; int main() { #ifndef ONLINE_JUDGE freopen("in.txt","r",stdin); #endif while(~scanf("%d",&n)&&n) { for(int i=0;i<n;i++) scanf("%d",&re[i]); if(n&1) { printf("1\n");continue; } sort(re,re+n); int t= 0; for(int i=0;i<n;i+=2) if(re[i]!=re[i+1]) t=1; printf("%d\n",t); } return 0; }
相关文章推荐
- POJ 1740 A New Stone Game(多堆博弈找规律)
- poj-1740 A New Stone Game 博弈论
- POJ 1740 A New Stone Game 已翻译
- 携程第二场 Poj 1182 食物链(带权并查集) Poj 1948 Triangular Pastures Poj(dp二维背包) 1740 A New Stone Game(博弈)
- POJ 1740 A New Stone Game
- poj 1740 A New Stone Game
- 【poj1740】 A New Stone Game
- POJ 1740 A New Stone Game
- poj 1740 A New Stone Game nim变形
- POJ 1740 A New Stone Game
- A New Stone Game POJ 1740
- [POJ1740]A New Stone Game(博弈)
- 【poj1740】 A New Stone Game
- poj 1740 A New Stone Game(博弈)
- POJ 1740 A New Stone Game
- POJ 1740 -- A New Stone Game ( 楼天城之男人系列 )
- POJ 1740 A New Stone Game
- poj 1740 A New Stone Game(博弈)
- poj1740 A New Stone Game
- 【POJ1740】A New Stone Game 构造博弈