http://acm.hdu.edu.cn/showproblem.php?pid=2147           

                kiki's game

Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 40000/10000 K (Java/Others)
Total Submission(s): 12133    Accepted Submission(s): 7393

Problem Description
Recently kiki has nothing to do. While she is bored, an idea appears in his mind, she just playes the checkerboard game.The size of the chesserboard is n*m.First of all, a coin is placed in the top right corner(1,m). Each time one people can move the coin into the left, the underneath or the left-underneath blank space.The person who can't make a move will lose the game. kiki plays it with ZZ.The game always starts with kiki. If both play perfectly, who will win the game?
 
Input
Input contains multiple test cases. Each line contains two integer n, m (0<n,m<=2000). The input is terminated when n=0 and m=0.
Output
If kiki wins the game printf "Wonderful!", else "What a pity!".
 
Sample Input
5 3
5 4
6 6
0 0
Sample Output
What a pity!
Wonderful!
Wonderful!
 
Author
月野兔
 
Source
 
Recommend
威士忌   |   We have carefully selected several similar problems for you:  1850 1847 1848 1849 1517 

19-格子游戏(hdu2147博弈)的更多相关文章

  1. 1647: [Usaco2007 Open]Fliptile 翻格子游戏

    1647: [Usaco2007 Open]Fliptile 翻格子游戏 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 423  Solved: 173[ ...

  2. [Usaco2007 Open]Fliptile 翻格子游戏

    [Usaco2007 Open]Fliptile 翻格子游戏 题目 Farmer John knows that an intellectually satisfied cow is a happy ...

  3. Fliptile 翻格子游戏

    问题 B: [Usaco2007 Open]Fliptile 翻格子游戏 时间限制: 5 Sec  内存限制: 128 MB 题目描述 Farmer John knows that an intell ...

  4. [BZOJ 1647][USACO 2007 Open] Fliptile 翻格子游戏

    1647: [Usaco2007 Open]Fliptile 翻格子游戏 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 702  Solved: 281[ ...

  5. [Usaco2007 Open]Fliptile 翻格子游戏题解

    问题 B: [Usaco2007 Open]Fliptile 翻格子游戏 时间限制: 5 Sec  内存限制: 128 MB 题目描述 Farmer John knows that an intell ...

  6. codevs 5972 格子游戏

    5972 格子游戏  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 黄金 Gold   题目描述 Description Alice和Bob玩了一个古老的游戏:首先画一个n * ...

  7. 格子游戏x(并查集)

    格子游戏 [问题描述] Alice和Bob玩了一个古老的游戏:首先画一个n * n的点阵(下图n = 3) 接着,他们两个轮流在相邻的点之间画上红边和蓝边:           直到围成一个封闭的圈( ...

  8. ACM: NBUT 1107 盒子游戏 - 简单博弈

     NBUT 1107  盒子游戏 Time Limit:1000MS     Memory Limit:65535KB     64bit IO Format:  Practice  Appoint ...

  9. Fliptile 翻格子游戏[Usaco2007 Open]

    题目描述 Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. ...

随机推荐

  1. Cam350导入Allegro的*.rou文件

    如果生产allegro的生产文件有椭圆形钻孔,生成.rou.直接自动导入到cam350是没办法成功的. 以下说说本人的步骤.allegro里面的单位都是mm 在cam350的File-->Imp ...

  2. java 执行JavaScript 以及容器化的问题

    1. 可选方案     a. jdk 6 开始内置的Rhino 引擎   b. jdk8 替换的nashorn (性能高,对于ECMA 支持更好)   c. java 版的nodejs vertx.i ...

  3. linux基础命令复习

    1.ls 查看文件和文件夹 1).ls -a 查看文件和文件夹,包括隐藏的 2).ls  -l 查看文件和文件夹详情 3).ls  -lh   查看文件和文件夹详情,自动生成文件大小单位 4).ls ...

  4. Collections排序

    0.前言 ThreeSet的底层实现是红黑树,它在创建set的过程中实现排序.Collections.sort是在对整个集合进行排序,按道理来说使用TreeSet插入集合元素直至建立整个TreeSet ...

  5. Java 程序员容易犯的10个SQL错误

    Java程序员编程时需要混合面向对象思维和一般命令式编程的方法,能否完美的将两者结合起来完全得依靠编程人员的水准: 技能(任何人都能容易学会命令式编程) 模式(有些人用“模式-模式”,举个例子,模式可 ...

  6. C语言通过地址传递参数

    // 正确 #include <stdio.h> struct para { int a; int b; }; struct para test = { .a = , .b = , }; ...

  7. Linux安装python

    1.打开终端,输入:wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0b4.tgz下载完毕后 2.输入解压命令:tar –zxvf Py ...

  8. nginx.conf几个示例

    #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #erro ...

  9. Java-Maven-Runoob:Maven Web 应用

    ylbtech-Java-Maven-Runoob:Maven Web 应用 1.返回顶部 1. Maven Web 应用 本章节我们将学习如何使用版本控制系统 Maven 来管理一个基于 web 的 ...

  10. 文件操作之增删改查3---文件的修改,f.replace(),在linux里的一些应用sed,with语句方法来打开一个或多个文件避免忘记关闭,python一行写的太长,怎么编写多行的规范

    f.replace()with open("xxx","r",encoding="utf-8") as f: 想修改文件中间的数据,有两个办 ...