在做题目之前如果一点也不懂还需要看一下博弈论的基础知识三大基础博弈
HDU 1846 Brave Game
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
int read(){
int v = 0,f = 1;
char c = getchar();
while(c < 48 || c > 57){ if(c == '-') f = -1; c = getchar();}
while(c >= 48 && c <= 57) {v = v*10 + c - 48; c = getchar();}
return v*f;
}
int main(){
int C,n,m;
C = read();
while(C--){
n = read(), m = read();
if(n%(m+1)) printf("first\n");
else printf("second\n");
}
return 0;
}
HDU 1847 Good Luck in CET-4 Everybody!
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
int read(){
int v = 0,f = 1;
char c = getchar();
while(c < 48 || c > 57){ if(c == '-') f = -1; c = getchar();}
while(c >= 48 && c <= 57) {v = v*10 + c - 48; c = getchar();}
return v*f;
}
int main(){
int n;
while(scanf("%d", &n) != EOF){
if(n%3) printf("Kiki\n");
else printf("Cici\n");
}
return 0;
}
HDU 1527 取石子游戏
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace