http://acm.hdu.edu.cn/showproblem.php?pid=1847

从1开始枚举情况,找规律。1先手胜2先手胜3先手败4先手胜5先手胜...

n只要能转移到先手败,就可以实现先手胜,否则n情况下就是先手败。发现规律时%3

 #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#define lson l, m, rt<<1
#define rson m+1, r, rt<<1|1
#define IO ios::sync_with_stdio(false);cin.tie(0);
#define INF 1e9
typedef long long ll;
using namespace std;
int t, n, m;
int main()
{
IO;
while(cin >> n){
if(n%==) cout << "Cici" << endl;
else cout << "Kiki" << endl;
}
return ;
}
05-11 20:01
查看更多