-- 自己 clu main mex targe ace string
- #include < cstdio > #include < cstring > #include < iostream > using namespace std;
- int sg[1200];
- int get(int x) {
- if (x < 0) return 0;
- if (sg[x] != -1) return sg[x];
- int mex[1200] = {
- 0
- };
- for (int i = 0; i < x; i++) {
- int t = get(i) ^ get(x - i - 1) ^ get(i - 1) ^ get(x - i - 2);
- mex[t] = 1;
- }
- for (int i = 0;; i++) if (!mex[i]) return sg[x] = i;
- }
- int main() {
- //freopen("a.txt","r",stdin);
- //freopen("b.txt","r",stdin);
- int t;
- memset(sg, -1, sizeof(sg));
- scanf("%d", &t);
- while (t--) {
- int n;
- scanf("%d", &n);
- if (n <= 2) {
- printf("zbybr\n");
- continue;
- }
- if (get(n - 1) || get(n - 2)) printf("blankcqk\n");
- else printf("zbybr\n");
- }
- return 0;
- }
山东省赛 - 博弈 - Game
来源: http://www.bubuko.com/infodetail-2251992.html