山东省赛-博弈-Game
来源:互联网 发布:qq一键加群里好友软件 编辑:程序博客网 时间:2024/06/10 04:04
点击打开题目链接
很明显的一道博弈题目,但是在求SG的时候,子状态写错了,一直都没有AC。最后还是水过去的额;比赛后还是自己写了一遍;
# 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;}
0 0
- 山东省赛-博弈-Game
- 2017山东省赛A题(SDUT3893威佐夫博弈+尼姆博奕)
- game--博弈
- Northcott Game + 博弈 + nim博弈
- 2017第八届浪潮杯山东省赛 A.Return of the Nim 博弈
- 山东省赛
- Game Theory: 公平博弈
- 2234-Matches Game-博弈
- HDU1846 Brave Game 博弈
- HDU_3389 Game 博弈
- Brave Game + 博弈
- Northcott Game + nim博弈
- Play a game + 博弈
- A Multiplication Game + 博弈
- hdu 4701 Game----博弈
- zoj 2290 GAME 博弈
- HDU 3389 Game (博弈)
- hdu3389 Game NIM博弈
- Linux内核-常见问题
- 元数据
- HDU 5371 Hotaru's problem
- 设置input,select,textarea不可编辑模式
- java调用http接口
- 山东省赛-博弈-Game
- DDos攻与防
- HDU 5375
- WAS生成的文件:javacore.***.txt 、heapdump.***.phd、core.***.dmp、Snap.***.trc
- Android普通应用程序使用system权限
- 归一化
- matlab中导入text文件
- PHP 访问 LDAP
- VC++----using namespace std问题