HDU 1847 cet-4 组合博弈

这道题也是一道简单的组合博弈题,状态图

0    1    2    3    4    5    6    7   8   9.........

P    N    N    p    N    N    p   N    N   P........可以看出,所有3的倍数都是P状态的。。。

View Code
/*
* Author:lonelycatcher
* Problem:HDU 1847
* Type:简单组合博弈
*/
#include
<iostream>
#include
<string.h>
#include
<string>
#include
<stdio.h>
#include
<cstdlib>
using namespace std;
int n;
int main()
{
while(cin>>n)
{
if(n%3==0)
{
printf(
"Cici\n");
continue;
}
printf(
"Kiki\n");
}
return 0;
}

posted on 2011-08-19 20:22  lonelycatcher  阅读(219)  评论(0编辑  收藏  举报

导航