#include #include #include #include #include #include using namespace std; #define MP make_pair #define PB push_back const int N=10005; vector mp[N],rv[N]; map< pair,int > vis; int f[N],p2i[N][N]; int dp[N*N][2]; int n,m; struct Dt{ int v,turn; Dt(){} Dt(int _v,int _turn){ v=_v; turn=_turn; } }; queue
que; void init(){ int id=0; for(int i=1;i<=n;++i) for(int j=i;j<=n;++j) p2i[j][i]=p2i[i][j]=id++; for(int i=0;i