题意:一个博弈中,n行20列的棋盘,给出每行棋子分布,每次可以将一个棋子移至其右侧最近的空位,求先手输赢。
题解:推了快一个小时的规律,结果发现有毛线规律啊,数据这么小,暴力不就好了嘛...对于某一个状态dfs搜他的子状态,求出每个位置的sg函数,n行的sg值异或起来就是答案了
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#define mem(x,y) memset(x,y,sizeof(x))
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,double> pii;
#define bug puts("===========");
#define zjc puts("");
const double pi=(acos(-1.0));
const double eps=1e-8;
const ll INF=1e18+10;
const ll inf=1e9+10;
const int mod=1e9+