No Gambling----对偶博弈
来源:互联网 发布:mysql安装密码 编辑:程序博客网 时间:2024/05/29 04:54
No Gambling
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65568/32768 K (Java/Others)Total Submission(s): 1783 Accepted Submission(s): 1303
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
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3863
这个题的意思是说给你一个对称图,第一个人只能走蓝色的点,第二个人只能走红色的点,第一个人的任务是从左走到右,第二个人的任务是从上走到下,谁先完成谁就赢了。。
我们易知,后手所搭建的桥的数量不可能比先手多,所以如果能赢一定是先手赢。
代码:
#include <cstdio>#include <cstring>#include <iostream>using namespace std;int main(){ int n; while(~scanf("%d",&n)&&n!=-1){ printf("I bet on Oregon Maple~\n"); } return 0;}
阅读全文
0 0
- No Gambling----对偶博弈
- hdu 3869 No Gambling 博弈
- No Gambling - HUD 3863 博弈
- hdoj 3863 No Gambling 【博弈】
- HDU 3863 No Gambling【博弈】
- HDOJ 题目1269No Gambling(博弈)
- HDU 3863 No Gambling 简单博弈
- HDU 3863 No Gambling(博弈)
- hdu 3863 No Gambling (水博弈规律)
- hdu3863——No Gambling(简单博弈)
- NYOJ 341 No Gambling
- hdu3863 No Gambling
- HDU3863:No Gambling
- HD3863 No Gambling
- 【hdu 3863】No Gambling
- hdu 3863 No Gambling
- HDU 3863 No Gambling 题解
- Gambling
- TCP/IP协议(三)——UDP与TCP的区别
- 520,IT工程师们都是如何表白的?
- 分治——归并排序
- springMVC 后台跳转前台,但是Ajax不进入回调函数
- session.load()和session.get()的区别
- No Gambling----对偶博弈
- Hbase快速单机部署和伪分布式部署,完全分布式部署
- Android 应用程序的图标 (Icon) 应该设计成多大
- 这样读源码,不牛X也难
- Java程序员的4大就业方向
- 面向对象的建模与设计
- hadoop文件读写过程
- spring定时器、linux计划任务的使用
- java设计模式--代理模式(二)