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

多写几个就会发现3的倍数是必败点,担心可能有例外,我一直写到第15个。。

 1 #include <cstdio>
 2
 3 int main()
 4 {
 5     int n;
 6     while(scanf("%d", &n) == 1 && n)
 7         printf("%s\n", n % 3 ? "Kiki" : "Cici");
 8
 9     return 0;
10 }

代码君

时间: 2024-12-17 08:17:35

HDU 1847 (博弈 找规律) Good Luck in CET-4 Everybody!的相关文章

HDU 2897 (博弈 找规律) 邂逅明下

根据博弈论的两条规则: 一个状态是必胜状态当且仅当有一个后继是必败状态 一个状态是必败状态当且仅当所有后继都是必胜状态 然后很容易发现从1开始,前p个状态是必败状态,后面q个状态是必胜状态,然后循环往复. 1 #include <cstdio> 2 3 int main() 4 { 5 int n, p, q; 6 while(scanf("%d%d%d", &n, &p, &q) == 3) 7 printf("%s\n", (

HDU 1564 Play a game (博弈&amp;&amp;找规律)

Play a game Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1430    Accepted Submission(s): 1168 Problem Description New Year is Coming! ailyanlu is very happy today! and he is playing a chessbo

HDU 1517 A Multiplication Game (博弈&amp;&amp;找规律)

A Multiplication Game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3691    Accepted Submission(s): 2097 Problem Description Stan and Ollie play the game of multiplication by multiplying an in

HDU 2147-kiki&#39;s game(博弈/找规律)

kiki's game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 40000/10000 K (Java/Others) Total Submission(s): 9174    Accepted Submission(s): 5485 Problem Description Recently kiki has nothing to do. While she is bored, an idea appears in his

51nod_1831: 小C的游戏(Bash博弈 找规律)

题目链接 此类博弈不需要考虑sg函数,只需要确定必胜态和必败态,解题思路一般为打败先打表找规律,而后找规律给出统一的公式.打表方式:给定初始条件(此题中为ok[0]=ok[1]=0),然后从低到高枚举某一状态的所有次态,若有存在必败次态,则当前状态为必胜态,否则当前状态必败. 题意:对单独一堆石子,支持两种操作:1.石子数-1:2.石子数变为原来石子数的某一因数.取走走后一堆或无法操作(面对n==0,坑啊..)者为负. 先打表找下规律 1 #include<bits/stdc++.h> 2 u

Acdream 1416 Crazy Nim(简单博弈找规律)

传送门 Crazy Nim Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) Submit Statistic Next Problem Problem Description Alice and Bob like to play crazy nim. The game proceeds as follows. There are several stones arranged in

ZOJ 2686 Cycle Game(博弈 找规律)

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1686 Here is a game played on a cycle by two players. The rule of this game is as follows: At first, a cycle is given and each edge is assigned a non-negative integer. Among those intege

HDU 1079 Calendar Game(博弈找规律)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1079 题目大意:给你一个日期(包含年月日),这里我表示成year,month,day,两人轮流操作,每次操作可以将month+1但是,如果下月没有对应的day则只能对day+1(超过该月日数就进入下月一日),或者就day+1.谁最后到达2001.11.4这个日期就是胜者,问先手的人是否能获胜. 解题思路:这个就用上面的P/N分析,一个个月份日期对应的标记上P或N(很快会发现规律只用找每月特定几天),

hdu 1564 Play a game(博弈找规律)

题目:一个n*n的棋盘,每一次从角落出发,每次移动到相邻的,而且没有经过的格子上. 谁不能操作了谁输. 思路:看起来就跟奇偶性有关 走两步就知道了 #include <iostream> using namespace std; int main() { int n; while(cin>>n&&n) { if((n*n-1)%2!=0) cout<<"8600"<<endl; else cout<<"