(博弈) HOJ 2939 Coin Question
2014-02-08 09:53
399 查看
Coin Question
My Tags | (Edit) |
---|
Source : ACM Group | |||
Time limit : 1 sec | Memory limit : 64 M |
2. One can place the coin anywhere on the table, but he can't place it on any other coins, even one corner is not allowed.
3. One can't let the coin which he places hang in the air, which means any part of the coin must be close to the table's surface.
4. The person who can't place a coin on the table loses the game.Input[/b]The input data are of various cases.Each case consists of two float numbers. Round table's radius R and the coin's radius r.The input ends with EOF.
Output[/b]For each case, If Mr. Wendy wins the game, you should output a line:
Yes, Mr. Wendy is a ****ing genius!
Or, you should output the line:
No, Mr. Pian is the real ****ing genius!
Sample Input[/b]4.00 4.00
4.00 5.00
Sample Output[/b]Yes, Mr. Wendy is a ****ing genius!
No, Mr. Pian is the real ****ing genius!
题意:有一张半径为R的桌子,然后有半径为r的硬币,然后两个人轮流在桌子上面放硬币,最后放不了硬币的人输。
思路:如果能想到还是很简单的,首先先放的人是能必定能赢得,如果一开始他能放的话,先放的人的策略是直接把一个硬币放在中心,然后对方放在哪里我们就放在他放的位置的中心对称的地方,那么最后一定是对方放不下。所以要自己输只有当硬币的大小比桌子大的时候才会输。
代码:#include<iostream>#include<cstdio>#include<cstring>#include<string.h>using namespace std;#define eps 1e-8int main(){ double R , r; while (cin>>R>>r) { if (R < r) printf("No, Mr. Pian is the real ****ing genius!\n"); else printf("Yes, Mr. Wendy is a ****ing genius!\n"); }}
相关文章推荐
- HOJ 2939 Coin Question
- hoj 2939 Coin Question
- HOJ 2939 Coin Question-------放硬币游戏
- hoj1848 Sg函数博弈
- HOJ 1907 博弈
- (简单) 博弈 HOJ 2128 S-Nim
- HOJ 1846 博弈 BASH game
- 取(2堆)石子游戏(威佐夫博弈)
- HDOJ 题目1850Being a Good Boy in Spring Festival(博弈)
- HDOJ 题目2076取(m堆)石子游戏(nim博弈)
- lightoj 1020 (博弈)
- 取(m堆)石子游戏 - HDU 2176 博弈
- codeforces round260 div1B&div2D A Lot of Games字典树上博弈
- CF455B - A Lot of Games(Trie树+博弈)
- hdu------(1525)Euclid's Game(博弈决策树)
- 杭电1279 Stone Game(经典博弈)
- (转)博弈问题与SG函数
- HDU4994-Revenge of Nim(博弈)
- HDU 5011-Game(博弈)
- HDU 1564 Play a game(博弈)