hdu 2147 kiki's game

简介:

http://acm.hdu.edu.cn/showproblem.php?pid=2147
这是一个巴什博弈的题,当两个数至少有一个数是偶数先手必胜
代码如下:

#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    int m,n;
    while(cin>>m>>n,m,n)
    {
        if(m%2 && n%2)
            puts("What a pity!");
        else
            puts("Wonderful!");
    }
    return 0;
}
目录
相关文章
HDOJ(HDU) 2148 Score(比较、)
HDOJ(HDU) 2148 Score(比较、)
107 0
|
Java
HDU 5882 Balanced Game
Balanced Game Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 508    Accepted Submission(s): ...
838 0
|
机器学习/深度学习 Java 网络架构
|
机器学习/深度学习 算法
[LeetCode] Dungeon Game
An interesting problem. The code is also short and clear. The basic idea is to use a 2d array dp[i][j] to denote the minimum hp that is required before entering dungeon[i][j].
741 0
|
机器学习/深度学习
|
安全 C++
Dungeon Game
The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid.
897 0