[POJ2484]A Funny Game
| Time Limit: 1000MS | Memory Limit: 65536K | |
| Total Submissions: 4533 | Accepted: 2780 |
Description
Figure 1
Note: For n > 3, we use c1, c2, ..., cn to denote the coins clockwise and if Alice remove c2, then c1 and c3 are NOT adjacent! (Because there is an empty place between c1 and c3.)
Suppose that both Alice and Bob do their best in the game.
You are to write a program to determine who will finally win the game.
Input
Output
Sample Input
1
2
3
0
Sample Output
Alice
Alice
Bob
Source
THINKING
博弈论问题,如果n<=2那么先手的会获得胜利,当n>=3时,先手的走了一步以后,后手的可以把这个一个大图分成两个完全相同的小图,每步都是如此,则在n步以后,先手的总会无棋可取,后手的获得胜利。
var t,n,i:longint;
begin
while true do
begin
readln(n);
if n= then halt;
if n<= then writeln('Alice')
else writeln('Bob');
end;
end.
[POJ2484]A Funny Game的更多相关文章
- POJ2484 A Funny Game[博弈论]
A Funny Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5401 Accepted: 3381 Desc ...
- [poj2484]A Funny Game(对称博弈)
题目:http://poj.org/problem?id=2484 题意:n个石子围成一个圈,两个人轮流取,每次可以取一个石子或者相邻的两个石子,问先手胜还是后手胜 分析: 典型的对称博弈 如果n&g ...
- POJ2484
A Funny Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6178 Accepted: 3861 Desc ...
- 【博弈论】poj2484 A Funny Game
如果当前状态可以根据某条轴线把硬币分成两个相同的组,则当前状态是必败态. 因为不论在其中一组我们采取任何策略,对方都可以采取相同的策略,如此循环,对方必然抽走最后一枚硬币. 因为我们先手,因此抽完后盘 ...
- 【POJ】1067 取石子游戏(博弈论)
Description 有两堆石子,数量任意,可以不同.游戏开始由两个人轮流取石子.游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子:二是可以在两堆中同时取走相同数量的石子.最后 ...
- 博弈论BOSS
基础博弈的小结:http://blog.csdn.net/acm_cxlove/article/details/7854530 经典翻硬币游戏小结:http://blog.csdn.net/acm_c ...
- 【Mark】博弈类题目小结(HDU,POJ,ZOJ)
转载请注明出处,谢谢http://blog.csdn.net/ACM_cxlove?viewmode=contents by---cxlove 首先当然要献上一些非常好的学习资料: 基础博弈的小 ...
随机推荐
- DELPHI关于文件的操作
caption:= ExtractFileExt(‘带路径,带扩展名的文件名’);//返回的就是扩展名 caption:= ChangeFileExt(ExtractFileName(‘带路径,带扩 ...
- Demo学习: CellDraw
CellDraw 学习TUniStringGrid,为什么有些设置在web模式下无效? case TUniBitBtn(Sender).Tag of : UniStringGrid1.ColWidth ...
- Linux下简易蜂鸣器驱动代码及测试实例
驱动代码: #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> ...
- Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).
[root@localhost ~]# cd /usr/local/mysql [root@localhost mysql]# chown -R mysql.mysql . [root@loc ...
- CentOS安装SetupTools(easy_install)
确保Py版本在2.6或以上 (旧版本需升级或参考旧版本安装) cd /opt wget https://pypi.python.org/packages/source/s/setuptools/set ...
- Python3.4 多线程
线程安全和全局解释器锁 Thread State and the Global Interpreter Lock 总结: 通过使用GIL后, Python多线程安全, 并且数据保持同步. Python ...
- npm常用命令解析
npm是什么 NPM的全称是Node Package Manager,是随同NodeJS一起安装的包管理和分发工具,它很方便让JavaScript开发者下载.安装.上传以及管理已经安装的包. npm ...
- Automotive Security的一些资料和心得(2):Cryptography
1. Security Goal - Confidentiality - Integrity - Availability - Authenticity - Non-repudiation - Aut ...
- pow(x,y):返回x的y次幂
>>> pow(2,3) 8 >>> pow(2,5) 32 >>> pow(2,8) 256 另外一种求x的y次幂的方法: >>&g ...
- Design Tutorial: Inverse the Problem
Codeforces Round #270 D:http://codeforces.com/contest/472/problem/D 题意:给以一张图,用邻接矩阵表示,现在问你这张图能不能够是一棵树 ...