摘要: http://poj.org/problem?id=3710 (说实话对于Tarjan算法在搞图论的时候就没搞太懂,以后得找时间深入了解) (以下有关无向图删边游戏的资料来自论文贾志豪《组合游戏略述——浅谈SG游戏的若干拓展及变形》) 首先,对于无向图的删边游戏有如下定理性质: 1.(Fushion Principle定理)我们可对无向图做如下改动:将图中的任意一个偶环缩成一个新点,任意一个... 阅读全文
posted @ 2016-03-07 02:19 &ATM 阅读(301) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2599 #include #include #include #include #include using namespace std; int n,k,pos; vector g[1005]; bool flag[1005]; int dfs(int k) { for(int i=0;i<g[k].size();i++) ... 阅读全文
posted @ 2016-03-07 02:05 &ATM 阅读(176) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2425 #include #include #include #include using namespace std; struct node { int to,next; }e[10000010]; int head[1010],Ecou; int sg[1010]; void add_edge(int u,int v) { ... 阅读全文
posted @ 2016-03-07 02:04 &ATM 阅读(182) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2068 #include #include #include #include using namespace std; int dp[25][(1<<13)+5];//dp[i][j]表示轮到第i个人取时,剩j个石头 int n,s,m[25]; int DFS(int pos,int remain) { if(dp[pos][r... 阅读全文
posted @ 2016-03-07 02:01 &ATM 阅读(241) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1678 #include #include #include #include using namespace std; const int INF=10e8; int n,a,b,p[10005],dp[10005]; int dfs(int x) { if(dp[x]!=-INF) return dp[x]; ... 阅读全文
posted @ 2016-03-07 02:00 &ATM 阅读(269) 评论(0) 推荐(0) 编辑
摘要: (Nim积相关资料来自论文曹钦翔《从“k倍动态减法游戏”出发探究一类组合游戏问题》) 关于Nim积计算的两个函数流程: 代码实现如下: int m[2][2]={0,0,0,1}; int Nim_Multi_Power(int x,int y) { if(x=(1=(1 #include using namespace std; in... 阅读全文
posted @ 2016-03-07 01:57 &ATM 阅读(792) 评论(0) 推荐(0) 编辑
……