kiki's game
kiki's gameTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 40000/10000 K (Java/Others) 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!
|
题解:聪明的人只会往能赢的点跑;
代码:
#include<stdio.h>
int main(){
int n,m;
while(scanf("%d%d",&m,&n),m||n){
if(m*n&)puts("What a pity!");
else puts("Wonderful!");
}
return ;
}
kiki's game的更多相关文章
- hdu 3579 Hello Kiki (中国剩余定理)
Hello Kiki Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- HDU 2147 kiki's game(博弈)
kiki's game Time Limit: 1000MS Memory Limit: 10000KB 64bit IO Format: %I64d & %I64u Submit S ...
- 周赛-kiki's game 分类: 比赛 2015-08-02 09:24 7人阅读 评论(0) 收藏
kiki's game Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 40000/10000 K (Java/Others) Total S ...
- HDU 2147 kiki's game (简单博弈,找规律)
kiki's game Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 40000/1000 K (Java/Others)Total ...
- hdoj 2147 kiki's game【博弈】
kiki's game Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 40000/10000 K (Java/Others)Total ...
- NYOJ 300 && hdu 2276 Kiki & Little Kiki 2 (矩阵高速功率)
pid=300">Kiki & Little Kiki 2 时间限制:5000 ms | 内存限制:65535 KB 难度:4 描写叙述 There are n light ...
- Hello Kiki(中国剩余定理——不互质的情况)
Hello Kiki Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Su ...
- KiKi's K-Number
KiKi's K-Number Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tot ...
- HDU 2147 kiki's game(规律,博弈)
kiki's game Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 40000/10000 K (Java/Others)Total ...
随机推荐
- pyqt QTableWidgetItem多行显示
def __2(self): t1=QtGui.QTableWidgetItem(self.names.text()) self.tabs.tableinsertinto.setItem(0,0,t1 ...
- pod setup 报CocoaPods was not able to update the `master` repo 错误解决办法
先删除全局的缓存: $ sudo rm -fr ~/Library/Caches/CocoaPods/ $ sudo rm -fr ~/.cocoapods/repos/master/ 还不行的话就把 ...
- 设置Eclipse启动JDK
打开eclipse安装目录下的eclipse.ini文件,将红色内容加入 -vm ../Java/jdk1.6.0_26/bin (或者指向具体目录:D:/software/jdk_1.8u91/bi ...
- Dave(正方形能围成的最大点数)
Dave Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submis ...
- java BingInteger生成2进制String循环移位时长度自动缩减
最近在做文本处理,使用MD5 生成一段文字的MD5哈希长度为32位也即128个0-1序列. 由于需要对这个MD5值进行循环移位,显然普通的 int 是不行的,所以使用 BigInteger.但是在使 ...
- [R语言画图]气泡图symbols
绘制气泡图主要使用函数symbols(x,y,circle=r).当中x.y是坐标轴,r是每一个点的半径. x<-rnorm(10) y<-rnorm(10) r<-abs(rnor ...
- boost::asio译文
Christopher Kohlhoff Copyright © 2003-2012 Christopher M. Kohlhoff 以Boost1.0的软件授权进行发布(见附带的LICENS ...
- HTTP协议5之代理--转
代理服务器 Web代理(proxy)服务器是网络的中间实体. 代理位于Web客户端和Web服务器之间,扮演“中间人”的角色. HTTP的代理服务器即是Web服务器又是Web客户端. Fiddler就是 ...
- Android 4.4前后版本读取图库图片和拍照完美解决方案
转载:http://blog.csdn.net/zbjdsbj/article/details/42387551 4.3或以下,选了图片之后,根据Uri来做处理,很多帖子都有了,我就不详细说了. 主要 ...
- jquery中的 ajax 以及map遍历
1.语法 $.ajax{ type:'get',//类型 有get post url:'',//路径 data:{name:$('#ma').val(),nameq:$('#maq').val()}, ...