POJ1740
来源:互联网 发布:简便算法公式 编辑:程序博客网 时间:2024/06/02 01:15
这题想了好久都没想出来 然后在网上搜的题解 终于明白了。。。
当为1堆的时候 先手为必胜态
当为2堆并且两堆都相同时 先手怎么走后手怎么走就行了
当为3堆 先手只要一次拿成两堆且相同 的情况就是必胜态
4堆的时候只要看排序后 两堆 两堆是否相同就行了
#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;bool f[1005];int main(){ int n; while (scanf("%d", &n)&& n) { memset(f, 0, sizeof(f)); int ans = 0; for (int i = 0; i < n; i++) { int a; scanf("%d", &a); if (f[a]) ans--; else ans++; f[a] = !f[a]; } if (ans) printf("1\n"); else printf("0\n"); } return 0;}
- poj1740
- POJ1740
- POJ1740
- POJ1740(找规律)
- POJ1740之构造博弈
- poj1740 A New Stone Game
- POJ1740 A New Stone Game
- 【poj1740】 A New Stone Game
- [poj1740]A New Stone Game
- 基础博弈论(hdu1527+hdu2188+poj1740)
- POJ1740 A New Stone Game 博弈
- poj1740 A New Stone Game 博弈
- 【POJ1740】A New Stone Game 构造博弈
- poj1740 A New Stone Game(博弈)
- [POJ1740]A New Stone Game(博弈)
- poj1740(A New Stone Game+男人八题之一)
- poj1740-楼教主所谓的男人八题之一
- POJ1740--A New Stone Game(Nin变形)
- 48 元素之和
- Global Variable in PL/SQL
- USB移动存储设备的检测、写入及弹出
- 移植android4.0内核时,Starting kernel ...没反应问题解决方法
- 子网掩码与子网划分
- POJ1740
- jsp servlet 乱码处理方法-表单提交的 pos 和get 方式
- Notes on <Papervision 3D Essentials> - 02
- 47.查找子字符串
- Flex读取本地图片文件为ByteArray并显示
- 创建索引
- cocos2d-x游戏开发(一)开始菜单
- 今年DevDays材料中文版已经可以下载
- eclipse 配置