摘要:
每次只能从取集合S中个数的物品,其他和普通Nim游戏相同 预处理出每种物品堆的sg值,然后直接xor一下,xor-sum>0即必胜 1 #include <set> 2 #include <map> 3 #include <cmath> 4 #include <queue> 5 #include < 阅读全文
posted @ 2020-02-20 22:12
墨鳌
阅读(181)
评论(0)
推荐(0)
摘要:
题目把Nim游戏为什么可以取异或和讲解得十分清楚,建议多读几次,理解一下 再一个,可以把每次异或视为一次取数,因此(k[i]^sg)<k[i]即为一种可行操作 /* Nim is a 2-player game featuring several piles of stones. Players a 阅读全文
posted @ 2020-02-20 12:21
墨鳌
阅读(157)
评论(0)
推荐(0)