【POJ】2484
来源:互联网 发布:数据库外键的设置语句 编辑:程序博客网 时间:2024/06/08 03:48
http://poj.org/problem?id=2484
一堆硬币环形放在桌上,Alice先取,Bob后取。
每次取一颗or取两颗,且只能取相邻的两颗。(相邻指中间不能有别的硬币或取走的硬币留下的空位)。取走最后一个硬币的人获胜。
输入硬币数,输出谁会获胜。(两人都够聪明)
《挑战程序设计竞赛》p307
当n>2时后手必胜。
#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <queue>#include <vector>#include <numeric>#include <algorithm>using namespace std;int n;int main(){ while (cin >> n&&n){ if (n<=2) cout << "Alice" << endl; else cout << "Bob" << endl; }}
阅读全文
0 0
- poj 2484
- poj-2484
- poj 2484
- 【POJ】2484
- POJ 2484 简单博弈
- poj 2484 博弈
- POJ 2484 (博弈)
- 对称博弈 POJ 2484
- POJ 2484 简单博弈
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- POJ
- poj
- 第一周开门作
- ZooKeeper_13_服务启动
- Intellij Idea Javaweb 目录结构及获取项目内资源
- Activiti
- 围棋-简单死活
- 【POJ】2484
- 八皇后问题
- C# 调用带有输出参数的分页存储过程
- 174. Dungeon Game
- JSP的三个编译指令
- Git服务器搭建及仓库克隆
- Struts2 系列之(3)类型转换
- 第三方SlidingMenu侧拉菜单
- 反馈(Feedback)