HDOJ 题目1269No Gambling(博弈)
来源:互联网 发布:上古世纪 范冰冰数据 编辑:程序博客网 时间:2024/05/21 08:57
No Gambling
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65568/32768 K (Java/Others)Total Submission(s): 1295 Accepted Submission(s): 899
Problem Description
One day, Flyvan introduced a new game to his two friends, Oregon Maple and Grape Skin. The game is quite simple. Given an N-sized grids, like the figure A shown below (as N = 4). The blue points are the places the first player can choose, and the red points are the places the second player can choose.
In the game, the two players take turns to choose two points to get connected by a stick. The two chosen points’ distance should be exactly one-unit length. The first player’s goal is to create a ‘bridge’ that connects a most left point and a most right point. The second player’s goal is to create a ‘bridge’ that connects a most top point and a most bottom point. Figure B shows a possible result (the first player won). In addition, the stick shouldn’t get crossed.
Now Flyvan will give the number N, and his two friends will play the game. Both of the two players will choose the best strategy. You can bet on one player, and if he wins the game, you’ll get twice money you bet~
Since you are a talented programmer, you surely won’t just do gambling. Please write a program to find out the player who you should bet on. As Oregon Maple is elder, he will always play first.
In the game, the two players take turns to choose two points to get connected by a stick. The two chosen points’ distance should be exactly one-unit length. The first player’s goal is to create a ‘bridge’ that connects a most left point and a most right point. The second player’s goal is to create a ‘bridge’ that connects a most top point and a most bottom point. Figure B shows a possible result (the first player won). In addition, the stick shouldn’t get crossed.
Now Flyvan will give the number N, and his two friends will play the game. Both of the two players will choose the best strategy. You can bet on one player, and if he wins the game, you’ll get twice money you bet~
Since you are a talented programmer, you surely won’t just do gambling. Please write a program to find out the player who you should bet on. As Oregon Maple is elder, he will always play first.
Input
Each line of the input is an integer N (2 <= N <= 270000), which indicated the number Flyvan chose. The end-of-file is denoted by a single line containing the number -1.
Output
If you think the first player will win, please output “I bet on Oregon Maple~”, else please output “I bet on Grape Skin~”.
Sample Input
2-1
Sample Output
I bet on Oregon Maple~
Source
2011 Multi-University Training Contest 3 - Host by BIT
Recommend
lcy | We have carefully selected several similar problems for you: 3861 3862 3865 3866 3868
不管n为多少,都是先手赢
ac代码
#include<stdio.h>int main(){int n;while(scanf("%d",&n)!=EOF,n!=-1){printf("I bet on Oregon Maple~\n");}}
0 0
- HDOJ 题目1269No Gambling(博弈)
- hdoj 3863 No Gambling 【博弈】
- HDU 3863 No Gambling(博弈)
- No Gambling----对偶博弈
- hdu 3869 No Gambling 博弈
- No Gambling - HUD 3863 博弈
- HDU 3863 No Gambling【博弈】
- hdu3863——No Gambling(简单博弈)
- HDU 3863 No Gambling 简单博弈
- hdu 3863 No Gambling (水博弈规律)
- HDOJ 题目3389 Game(阶梯博弈)
- HDOJ 题目3951Coin Game(博弈)
- HDOJ 题目 1079 Calendar Game(博弈)
- NYOJ 341 No Gambling
- hdu3863 No Gambling
- HDU3863:No Gambling
- HD3863 No Gambling
- 【hdu 3863】No Gambling
- 内联汇编
- startActivityForResult()用法
- Oracle中merge into的使用
- Codeforces Round #262 (Div. 2)E(贪心+暴搜)
- 内存的几个区
- HDOJ 题目1269No Gambling(博弈)
- 杭电1269 迷宫城堡(强联通)
- android-拍照回调
- Vista 风格文件选择对话框笔记
- OpenCV简介
- InstallAnywhere 制作安装包介绍 2
- struts1和cos实现文件上传
- 节点的操作 创建、添加、移除、移动、复制
- hdu1231 最大连续子序列