hdoj 3863 No Gambling 【博弈】

本文探讨了一个基于网格布局的两人策略博弈游戏,玩家通过选择连接两点来创建桥梁,目标分别为连接最左和最右点(第一玩家),以及最上和最下点(第二玩家)。游戏提供了一个输入整数N的场景,表示网格大小,用于预测胜利方并据此进行投注决策。分析了在不同N值情况下,第一玩家始终能够获胜的可能性。

No Gambling

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65568/32768 K (Java/Others)
Total Submission(s): 1503    Accepted Submission(s): 1080


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.
 

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~
分析:
无论n为多少,先手者赢。
代码:
#include<stdio.h>
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF,n!=-1)
	{
		printf("I bet on Oregon Maple~\n");
	}
	return 0;
} 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值