随笔分类 -  博弈论—SG函数

该文被密码保护。
posted @ 2019-04-20 17:00 lokiii 阅读(4) 评论(0) 推荐(0)
摘要:先预处理出来sg值,然后先手必败状态就是sg[a[i]]的xor和为0(nim) 如果xor和不为0,那么一定有办法通过一步让xor和为0,具体就是选一个最大的sg[a[i]],把它去成其他sg值的xor和,这样后手的xor和就是0了 当然并不一定要取最大的,只要sg[a[i]] (ans^sg[a 阅读全文
posted @ 2018-12-04 09:20 lokiii 阅读(199) 评论(0) 推荐(0)
摘要:也就是转换到树形删边游戏,详见 https://wenku.baidu.com/view/25540742a8956bec0975e3a8.html cpp include include include using namespace std; const int N=1005; int T,n, 阅读全文
posted @ 2018-12-03 21:35 lokiii 阅读(128) 评论(0) 推荐(0)
摘要:预处理出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= 阅读全文
posted @ 2018-12-03 19:57 lokiii 阅读(135) 评论(0) 推荐(0)