摘要:
题意:给定一个有向无环图,然后上面的一些结点上面有棋子,每次一个人可以选择一枚棋子走到与它相邻的点,不能走的就输了。然后给出初态,判断胜负。题解:图上面的SG博弈,dfs求SG函数,然后依次取异或就行了。View Code 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 int sg[1005],head[1005],nc; 6 struct Edge 7 { 8 int to,next; 9 }edge[1000000];10 voi 阅读全文