zoukankan      html  css  js  c++  java
  • 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 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
     
     
     
    解析:两名选手都采取最佳策略,棋盘完全对称,目标相同,先手必胜!!!
     
     
     
     1 #include <cstdio>
     2 
     3 int main()
     4 {
     5     int N;
     6     while(scanf("%d",&N) && N != -1){
     7         printf("I bet on Oregon Maple~
    ");
     8     }
     9     return 0;
    10 }
  • 相关阅读:
    Linux日志文件/var/log详解
    QT 的信号与槽机制介绍
    利用线程通信,写2个线程,一个线程打印1~52,另一个线程打印A~Z,打印顺序应该使12A34B56C···5152Z
    mysql快速安装
    zabbix安装源
    mysql手动安装
    没有可用软件包 zabbixservermysql
    【转载】web 部署专题(一):Gunicorn运行与配置方法
    supervisor快速配置
    linux监控脚本状态失败后拉起
  • 原文地址:https://www.cnblogs.com/inmoonlight/p/5177988.html
Copyright © 2011-2022 走看看