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

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;
}

相关文章:

  • 2021-11-16
  • 2021-12-23
  • 2021-07-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-09
  • 2021-12-07
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
相关资源
相似解决方案