博弈论—— Good Luck in CET-4 Everybody! HDU - 1847

这里写图片描述
这里写图片描述

题解:
画NP图——举个例子
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

N NPN N PNN P N N P N N P N

根据NP图中比盛典和必败点的特点画出来,在这篇博客里有对NP图比较详细的介绍
https://blog.csdn.net/qq_40240576/article/details/82630992

画完NP图后可以看出当n为3的倍数时,必输。

#include<iostream>
#include<cstdio>
#include<map>
#include<algorithm>
#include<cmath>
#define LL long long int
using namespace std;
int n,ha[1005],sg[1005];

int f(int k)
{
    return pow(2,k);
}

int main()
{
    while(~scanf("%d",&n))
    {
        if(n%3 == 0) 
            printf("Cici\n");   
        else 
            printf("Kiki\n");
    }
    return 0;
} 

猜你喜欢

转载自blog.csdn.net/qq_40240576/article/details/82662491