hdu1847 Good Luck in CET-4 Everybody!(巴什博弈)

Posted Surprisez

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hdu1847 Good Luck in CET-4 Everybody!(巴什博弈)相关的知识,希望对你有一定的参考价值。

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

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

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

 1 #include<iostream>
 2 #include<cstdio>
 3 #include<cstring>
 4 #include<algorithm>
 5 #include<cstdlib>
 6 #include<cmath> 
 7 #define lson l, m, rt<<1
 8 #define rson m+1, r, rt<<1|1
 9 #define IO ios::sync_with_stdio(false);cin.tie(0);
10 #define INF 1e9
11 typedef long long ll;
12 using namespace std;
13 int t, n, m;
14 int main()
15 {
16     IO;
17     while(cin >> n){
18         if(n%3==0) cout << "Cici" << endl;
19         else cout << "Kiki" << endl;
20     }
21     return 0;
22 }

 

以上是关于hdu1847 Good Luck in CET-4 Everybody!(巴什博弈)的主要内容,如果未能解决你的问题,请参考以下文章

hdu 1847 Good Luck in CET-4 Everybody!(sg)

HDU 1847 Good Luck in CET-4 Everybody!(规律,博弈)

HDU 1847 Good Luck in CET-4 Everybody! (sg函数)

HDU 1847 Good Luck in CET-4 Everybody!(SG函数)

HDU 1847 Good Luck in CET-4 Everybody!(博弈找规律)

hdu1847 Good Luck in CET-4 Everybody!(巴什博弈)