题意:有n堆石子,每次可以将其中一堆分为数量不为0的3堆,或者从其中一堆中拿走若干个,最终拿完的那个人赢. 思路:直接暴力SG状态,然后找出其中的规律,异或一下每一堆的状态就可以了. #include<bits/stdc++.h> using namespace std; typedef long long ll; ;bool flag[maxn]; int sg[maxn]; int getSg(int x){ ) return sg[x]; memset(flag, , sizeof(fl…