摘要: #include <iostream> #include <cstring> #include <algorithm> #include <unordered_set> using namespace std; const int N = 110, M = 10010; int n, k; int 阅读全文
posted @ 2021-12-01 20:53 _vv123 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 题意:如果nim游戏先手必胜,输出第一步的可行方案数,否则输出0。 我们知道,nim游戏的N-position为所有石子数异或非0,P-position为所有石子数异或得0,因为: 1.终点时所有石子数为0 2.如果当前是N-position,即异或和sum非0,则一定存在一堆石子的数量大于其他堆的 阅读全文
posted @ 2021-12-01 20:00 _vv123 阅读(37) 评论(0) 推荐(0) 编辑