POJ 2484
| Time Limit: 1000MS | Memory Limit: 65536K | |
| Total Submissions: 3861 | Accepted: 2311 |
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
#include <iostream>
#include <cstdio> using namespace std; int N;
int main()
{
while(~scanf("%d",&N) && N) {
printf("%s\n",N <= ? "Alice" : "Bob");
}
//cout << "Hello world!" << endl;
return ;
}
POJ 2484的更多相关文章
- POJ 2484(对称博弈)
题目链接:http://poj.org/problem?id=2484 这道题目大意是这样的,有n个硬币围成一圈,两个人轮流开始取硬币(假设他们编号从1到n),可以选择取一枚或者取相邻的两枚(相邻是指 ...
- POJ 2484 A Funny Game 博弈论 对称博弈
http://poj.org/problem?id=2484 1和2时Alice必胜,3时Bob必胜,其他情况下Bob只需要在Alice取过之后取一次将剩下的硬币链平均分为两份,然后Alice怎么取B ...
- POJ 2484 A Funny Game【博弈】
相比数据结构的题..感觉这种想啊想的题可爱多了~~~代码量还少.... 题目链接: http://poj.org/problem?id=2484 题意: 一圈n个硬币,两人轮流从中取一或两个硬币,(只 ...
- poj 2484 A Funny Game(博弈)
A Funny Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4639 Accepted: 2855 Desc ...
- POJ 2484 A Funny Game(智商博弈)
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6397 Accepted: 3978 Description Alice ...
- POJ 2484 A Funny Game(博弈论)
题目链接: 传送门 A Funny Game Time Limit: 1000MS Memory Limit: 10000K Description Alice and Bob decide ...
- 【POJ 2484】A Funny Game
Description Alice and Bob decide to play a funny game. At the beginning of the game they pick n(1 &l ...
- POJ 2484 A Funny Game(神题!)
一开始看这道博弈题的时候我就用很常规的思路去分析了,首先先手取1或者2个coin后都会使剩下的coin变成线性排列的长条,然后无论双方如何操作都是把该线条分解为若干个子线条而已,即分解为若干个子游戏而 ...
- [原博客] POJ 2484 A Funny Game
题目链接题意:有n个硬币排成一圈,两个人轮流操作,每次可以取走一个或者相邻的连个硬币(只算最开始相邻的,取之后才相邻的不算),问先手必胜还是必败. 这个题可以证明若n>=3,则先手必败.对称博弈 ...
随机推荐
- C#学习笔记(补充)——扩展方法、事件
(搬运自我在SegmentFault的博客) 一.扩展方法 扩展方法使你能够向现有类型"添加"方法,而无需创建新的派生类型.重新编译或以其他方式修改原始类型. 注意事项: 扩展方法 ...
- Node.js express路由简单分析
这2天看了一点node+express的路由源码有了一点眉目,总结一下 对于app.get, 首先给出一张类图: 图1 注意每个路由有一个stack,这个stack中存放了Layer. 路由系统内有三 ...
- JavaWeb之 JSP:自定义标签
当jsp的内置标签和jstl标签库内的标签都满足不了需求,这时候就需要开发者自定义标签. 自定义标签 下面我们先来开发一个自定义标签,然后再说它的原理吧! 自定义标签的开发步骤 步骤一 编写一个普通的 ...
- Java入门到精通——基础篇之面向对象
一.概述. Java属于面向对象的一种语言,因为Java是面向对象的语言所以这个语言的诞生需要有五个基本特性: 1)万物皆为对象. 2)程序是对象的集合. 3)每个对象都有自己的由其他对象所构成的存储 ...
- golang反射初试
golang反射来自Go AST(Abstract Syntax Tree). reflect操作更多像traverse AST. t := reflect.TypeOf(obj) 使用TypeOf( ...
- [译]AMQP 0-9-1 Quick Reference : basic
Basic basic.ack(delivery-tag delivery-tag, bit multiple)Support: fullAcknowledge one or more message ...
- iOS中远程推送实现—在Apple的生产环境上测试Push Notifications功能
1.在“Provisioning Profiles”中点击“Add”按钮. 2.在“What type of provisioning profile do you need?”页面中选择“Distr ...
- 两个有用的shell工具总结
shell工具之一:sed sed基础 sed编辑器被称作流编辑器,与常见的交互式文本编辑器刚好相反.文本编辑器可以通过键盘来交互式地插入.删除.替换文本中的数据:而流编辑器是基于一组预先的规则来编辑 ...
- [转]分布式文件系统FastDFS架构剖析
[转]分布式文件系统FastDFS架构剖析 http://www.programmer.com.cn/4380/ 文/余庆 FastDFS是一款类Google FS的开源分布式文件系统,它用纯C语言实 ...
- UAT测试,PPT测试
UAT:user acceptable testing 用户验收测试 PPT:product produce test 产品生产验证