解题报告:其实这题就是没有上司的舞会和战略游戏的翻版,,类似于状态机f[u][j] 以u为根节点,j有0,1,2,分别表示被父节点侦察到,被子节点侦察到,自己身上放守卫。 #include<iostream> #include<cstring> using namespace std; const int N=1510; int f[N][3]; int n; int h[N],e[N*2],idx,ne[N*2],w[N*2]; bool st[N]; void add(int a,int b) { e[idx]=b,ne[idx]=h[a],h[a]...