小牛vs小客
小牛vs小客
https://ac.nowcoder.com/acm/problem/15065
n>=3时后手必赢,因为先手无论什么操作,后手跟他进行对称操作即可。
#include <bits/stdc++.h> #include <unordered_map> using namespace std; typedef long long ll; typedef unsigned long long ull; #ifdef LOCAL #define debug(x) cout << "[" __FUNCTION__ ": " #x " = " << (x) << "]\n" #define TIME cout << "RuningTime: " << clock() << "ms\n", 0 #else #define TIME 0 #endif #define hash_ 1000000009 #define Continue(x) { x; continue; } #define Break(x) { x; break; } const int mod = 998244353; const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3f; #define gc p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ? EOF : *p1++; inline int read(){ static char buf[1000000], *p1 = buf, *p2 = buf; register int x = false; register char ch = gc; register bool sgn = false; while (ch != '-' && (ch < '0' || ch > '9')) ch = gc; if (ch == '-') sgn = true, ch = gc; while (ch >= '0'&& ch <= '9') x = (x << 1) + (x << 3) + (ch ^ 48), ch = gc; return sgn ? -x : x; } ll fpow(ll a, int b, int mod) { ll res = 1; for (; b > 0; b >>= 1) { if (b & 1) res = res * a % mod; a = a * a % mod; } return res; } int main() { #ifdef LOCAL freopen("E:/input.txt", "r", stdin); #endif int n; while (cin >> n) { printf("%s\n", n < 3 ? "XiaoNiu" : "XiaoKe"); } return TIME; }