No Gambling

No Gambling

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65568/32768 K (Java/Others)

Total Submission(s): 1302    Accepted Submission(s): 905

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~

Source

题意:

第一个人从上往下连红点

第二个人从左往右连蓝点

连线得多的人胜

这题就是英文看不懂 ,知道题意了就可以知道两个人开始所面临的状态是一样的,所以先手必胜

#include<iostream>
using namespace std;
int main()
{
    int n;
    while(cin>>n)
    {
        if(n==-1)break;
        cout<<"I bet on Oregon Maple~"<<endl;
    }
    return 0;
}
时间: 2024-10-14 21:53:08

No Gambling的相关文章

HDU 3863 No Gambling

No Gambling Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65568/32768 K (Java/Others)Total Submission(s): 1528    Accepted Submission(s): 1091 Problem Description One day, Flyvan introduced a new game to his two friends, Oregon Maple and Gr

CodeForces - 662A:Gambling Nim (求有多少个子集其异或为S)(占位)

As you know, the game of "Nim" is played with n piles of stones, where the i-th pile initially contains ai stones. Two players alternate the turns. During a turn a player picks any non-empty pile and removes any positive number of stones from it

hdu 3863 No Gambling (不会证明,但是是对的,,)

题意: N=4时 规则: 双方每次可以连接自己颜色的两个点(相邻,长度为1),线和线不能交叉重叠. 蓝方要连接左右,红方要连接上下. 蓝方先.问谁先连接? 思路: 经过观察....蓝方胜.......(无语)[我不知道如何证明!] 代码: 就不贴了...

CodeForces - 662A Gambling Nim

http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概率是在正面,各个卡牌独立.求把所有卡牌来玩Nim游戏,先手必胜的概率. (⊙o⊙)-由于本人只会在word文档里写公式,所以本博客是图片格式的. Code 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm

HDU 3863 (博弈) No Gambling

这是我见过的最简单的一道博弈了,其实不要被复杂的棋盘吓到了. 首先肯定会有而且仅有一个人胜,而且因为棋盘是对称的,所以先手相对于后手肯定更有优势,那么肯定是先手赢. 这是不是严格的推理,但是确实比较容易猜出答案. 题外话:既然这游戏这么坑,为什么两个人还能玩得不亦乐乎.. 1 #include <cstdio> 2 3 int main() 4 { 5 int n; 6 while(scanf("%d", &n) && n + 1) puts(&qu

codeforces 1038C. Gambling(思维,模拟)

time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Two players A and B have a list of nn integers each. They both want to maximize the subtraction between their score and their opponent's sco

April 23 2017 Week 17 Sunday

It is a characteristic of wisdom not to do desperate things. 不做孤注一掷的事情是智慧的表现. We are told that we had better not to put all our eggs into one basket, that means, we must learn how to spread the risks so as to reduce the potential risks to the minimum

[转]苹果商店审核规则,你触犯了哪一条?

1. Terms and conditions(法律与条款)1.1 As a developer of applications for the App Store you are bound by the terms of the Program License Agreement (PLA), Human Interface Guidelines (HIG), and any other licenses or contracts between you and Apple. The fol

ios 应用发布appStore

1.进入管理界面开发商 [点击 iTunes Connect] 2.进入管理apps界面 [点击 Manage Your Apps] watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYWxpbmNleGlhb2hhbw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" > 3.加入新的app [点击 Add New App] 4.填写 app