HDU-3863 No Gambling

來源:互聯網
上載者:User

標籤:des   style   blog   http   color   java   os   io   

             http://acm.hdu.edu.cn/showproblem.php?pid=3863                    No Gambling

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


Problem DescriptionOne 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. 

 

InputEach 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. 

 

OutputIf you think the first player will win, please output “I bet on Oregon Maple~”, else please output “I bet on Grape Skin~”. 

 

Sample Input2-1 

 

Sample OutputI bet on Oregon Maple~這題,我就認為第一個贏,就這麼寫就過了,但我不相信於是看了別人的解題報告,好複雜。。。。。是我太水了。
#include<iostream>#include<cstdio>using namespace std;int main(){    int n;  while(~scanf("%d",&n))  {      if(n==-1)         break;      else         printf("I bet on Oregon Maple~\n");  }  return 0;}

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.