HDU 1847 Good Luck in CET-4 Everybody! 简单博弈

题目大意:

题面中文, 题意就不说了


大致思路:

就是确定一下NP点就可以了, 简单的递推


代码如下:

Result  :  Accepted     Memory  :  1616 KB     Time  :  0 ms

/*
 * Author: Gatevin
 * Created Time:  2015/4/28 21:18:46
 * File Name: Rin_Tohsaka.cpp
 */
#include<iostream>
#include<sstream>
#include<fstream>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cctype>
#include<cmath>
#include<ctime>
#include<iomanip>
using namespace std;
const double eps(1e-8);
typedef long long lint;
#define foreach(e, x) for(__typeof(x.begin()) e = x.begin(); e != x.end(); ++e)
#define SHOW_MEMORY(x) cout<<sizeof(x)/(1024*1024.)<<"MB"<<endl

bool num[2000];

int main()
{
    memset(num, 1, sizeof(num));
    for(int i = 1; i <= 1000; i++)
        for(int j = 0; (1 << j) <= i; j++)
            if(num[i - (1 << j)])
                num[i] = 0;
    int n;
    while(scanf("%d", &n) != EOF)
        if(num[n]) puts("Cici");
        else puts("Kiki");
    return 0;
}


你可能感兴趣的:(HDU,1847,简单博弈)