2013年5月31日
摘要: 题目链接。题意:两人轮流乘一个2-9的数,从1开始乘,求谁的乘积先大于N。分析: 如果是加法就好做了。凑到剩下的数能整除11,然后对称着加。问题是乘法。所以寻找必胜点(段)。以1000为例。 1000 | 999 ... 112 | 若占住999到112,则对手必胜。必须让对手占领此段。 1000 | 999 ... 112 |111 ... 56 | 因此必占段是111 -? 。如果56被对手占住,则56×2=112,入必败段。问题转化成为占56。 如此循环。如下 1000 | 999 ... 112 |111 ... 56 |55 ... 7 | 6 ... 4 | 3 ... 阅读全文
posted @ 2013-05-31 21:16 Still_Raining 阅读(494) 评论(4) 推荐(0)
摘要: 题目链接。分析:SG模版。详情请参见LCY的课件:http://acm.hdu.edu.cn/forum/read.php?tid=6875AC代码如下:#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;const int maxn = 100 + 10;int sg[10000+10], a[maxn], k;int mex(int n) { bool vis[maxn] = {false}; for(int 阅读全文
posted @ 2013-05-31 21:12 Still_Raining 阅读(349) 评论(0) 推荐(0)