hdu2147 kiki's game(博弈)

这个是纳什博弈?不知道怎么看的

依据PN图,从左下角開始推

左下角P

最后一行都是PNPNPN

第一列都是

P

N

P

N

P

完了填完即可了

#include<cstdio>
int main()
{
    int n,m;
    while(scanf("%d%d",&n,&m)&&n&&m){
        if(n&1&&m&1) printf("What a pity!\n");
        else printf("Wonderful!\n");
    }
    return 0;
}

hdu2147 kiki's game(博弈)

时间: 2024-08-03 08:53:26

hdu2147 kiki&#39;s game(博弈)的相关文章

hdu2147 kiki&#39;s game(博弈)

这个是纳什博弈?不知道怎么看的 根据PN图,从左下角开始推 左下角P 最后一行都是PNPNPN 第一列都是 P N P N P 完了填完就行了 #include<cstdio> int main() { int n,m; while(scanf("%d%d",&n,&m)&&n&&m){ if(n&1&&m&1) printf("What a pity!\n"); else

hdoj 2147 kiki&#39;s game【博弈】

kiki's game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 40000/10000 K (Java/Others)Total Submission(s): 8041    Accepted Submission(s): 4781 Problem Description Recently kiki has nothing to do. While she is bored, an idea appears in his m

hdu2852 KiKi&amp;#39;s K-Number

Problem Description For the k-th number, we all should be very familiar with it. Of course,to kiki it is also simple. Now Kiki meets a very similar problem, kiki wants to design a container, the container is to support the three operations. Push: Pus

组合博弈入门

人生有“三晃”:一晃大了,一晃老了,一晃没了.我晃一下就够了... 以下为网上搜集资料的汇总: 组合游戏定义:        1.有且仅有两个玩家    2.游戏双方轮流操作    3.游戏操作状态是个有限的集合(比如:取石子游戏,石子是有限的,棋盘中的棋盘大小的有限的)  4.游戏必须在有限次内结束  5.当一方无法操作时,游戏结束. (一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m个.最后取光者得胜.     显然,如果n=m+

=-098765

http://ypk.39.net/search/all?k=%A1%B8%D4%E6%D1%F4%C3%D4%BB%C3%D2%A9%D4%F5%C3%B4%B9%BA%C2%F2Q%A3%BA%A3%B6%A3%B9%A3%B5%A3%B2%A3%B5%A3%B6%A3%B7%A3%B1%A3%B7%A8%7C http://ypk.39.net/search/all?k=%A8%93%D2%CB%B3%C7%C3%D4%BB%C3%D2%A9%D4%F5%C3%B4%B9%BA%C2%F2

ACM-巴什博弈之kiki&#39;s game——hdu2147

kiki's game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 40000/1000 K (Java/Others) Total Submission(s): 5987    Accepted Submission(s): 3556 Problem Description Recently kiki has nothing to do. While she is bored, an idea appears in his m

hdu2174 kiki&#39;s game 博弈

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

HDU 2147 kiki&#39;s game(博弈图上找规律)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2147 题目大意:给你一个n*m的棋盘,初始位置为(1,m),两人轮流操作,每次只能向下,左,左下这三个方向移动,谁最后无法移动棋子就输掉比赛,问先手是否会获胜. 解题思路:简单题,P/N分析找规律,以(n,m)点为结束点推到起始点,如图: 发现每个田字格的状态都是一样的,因为(n,m)点一定时P态,所以可以得出规律:只有当(m%2==1&&n%2==1)时,先手才会输. 代码: 1 #incl

HDU 2147 kiki&#39;s game(规律,博弈)

kiki's game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 40000/10000 K (Java/Others)Total Submission(s): 10763    Accepted Submission(s): 6526 Problem Description Recently kiki has nothing to do. While she is bored, an idea appears in his