摘要:
必败状态是n为偶数并且数量相同的石子堆可以两两配对,因为这样后手可以模仿先手操作 其他状态一定可以由先手给后手一步拼出一个必败状态(用最大堆补) cpp include include include using namespace std; const int N=100005; int n,a[ 阅读全文
摘要:
也就是转换到树形删边游戏,详见 https://wenku.baidu.com/view/25540742a8956bec0975e3a8.html cpp include include include using namespace std; const int N=1005; int T,n, 阅读全文
摘要:
预处理出SG函数,然后像普通nim一样做即可 cpp include include using namespace std; const int N=10005; int k,s[N],m,n,sg[N],v[N],ti,ans; int read() { int r=0,f=1; char p= 阅读全文
摘要:
如果全是1,那么n是奇数先手必败 否则,xor和为0先手必败 证明见 https://www.cnblogs.com/Wolfycz/p/8430991.html cpp include include using namespace std; const int N=55; int T,n,a[N 阅读全文
摘要:
把连边和不连边看成黑白染色,然后就变成了 https://www.cnblogs.com/lokiii/p/10055629.html 这篇讲得好!https://blog.csdn.net/wzq_qwq/article/details/48035455 cpp include include u 阅读全文