2012年10月16日
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1760dfs+ 博弈代码:#include<iostream>#include<cstdio>#include<cstring>#include<string>#include<vector>#include<queue>#include<map>#include<stack>#include<algorithm>#include<cmath>using namespace std;//#p 阅读全文
posted @ 2012-10-16 21:44 夜-> 阅读(135) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1729SG处理 博弈在 容量为 c ,现有数量为 s 的情况下特殊情况:s==0 则 return 0; 否则:找到一个整数 t ,t 满足 t+t*t<c 而已 (t+1)+(t+1)*(t+1)>=c ,这样的话 从 t+1 到 c-1 都为必胜态 而 s==c 时为必败态只要 s 在 t+1 <= s <= c 它对应到S-Nim里面的 值就是 c-s因为 这时的 s 可以到达 s-1,s-2,s-3,.......,c. 归纳一下的话 就是 c-s但如果 s <= t 则 阅读全文
posted @ 2012-10-16 20:41 夜-> 阅读(184) 评论(0) 推荐(0)