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~
题目大意就是先手从左到右依次连蓝色的点形成一条通路,后手从上到下依次连红色的点形成一条通路,连的时候红线和蓝线不能交叉
这道题目看起来很难,但其实很水,想明白了就很简单了,因为图是完全对称的,又因为先手和后手都采用的最优策略,对称之后大家的策略其实是一样的,先手有先一步的优势,先手必胜!
附上ac代码
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
using namespace std;
typedef long long ll;
int main()
{
std::ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
ll n;
while(cin>>n&&n>0)
{
cout<<"I bet on Oregon Maple~"<<endl;
}
return 0;
}