No Gambling - HUD 3863 博弈
来源:互联网 发布:python写抢票程序 编辑:程序博客网 时间:2024/06/06 10:08
No Gambling
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65568/32768 K (Java/Others)Total Submission(s): 1450 Accepted Submission(s): 1035
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~”.
题意:每个人每次可以用单位长度为1的线连接点,先手只能连蓝色的,后手只能连红色的,先手的目标是从最左边到最右边连接一个桥,后手的目标是从最上边到最下边连接桥,问先手胜负。
思路:我们可以发现后手是挡不住先手的,所以先手必胜。
AC代码如下:
#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>using namespace std;typedef long long ll;int T,t,n,m;int main(){ int i,j,k; while(~scanf("%d",&n) && n>0) { printf("I bet on Oregon Maple~\n"); }}
0 0
- No Gambling - HUD 3863 博弈
- hdoj 3863 No Gambling 【博弈】
- HDU 3863 No Gambling【博弈】
- HDU 3863 No Gambling 简单博弈
- HDU 3863 No Gambling(博弈)
- hdu 3863 No Gambling (水博弈规律)
- No Gambling----对偶博弈
- hdu 3869 No Gambling 博弈
- 【hdu 3863】No Gambling
- hdu 3863 No Gambling
- HDOJ 题目1269No 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 (博弈论、对称性、水)
- javax.xml.ws.WebServiceException: No Content-type in the header!
- android4.0Caused by: android.os.NetworkOnMainThreadException问题
- PAT 1019 General Palindromic Number
- OSPF协议总结
- HDOJ-5277 YJC counts stars(DFS)
- No Gambling - HUD 3863 博弈
- CentOS下搭建DNS服务器
- Leetcode_228_Summary Ranges
- 51NOD算法马拉松 最大值问题 离线预处理+set lower_bound
- 有道词典
- GitHub学习笔记
- 高斯消元 POJ 1830 1222 1753
- mysql的分区技术详细介绍
- oracle coalesce函数