#include<iostream> #include<cstdio> #include<string> #include<cstring> #include<algorithm> using namespace std; ; struct edge{ int to; int nxt; }; int n,g[maxn],dep[maxn],dpd[maxn],dpv[maxn]; int head[maxn],cnt; edge e[maxn];…
#include<iostream> #include<cstdio> #include<string> #include<cstring> #include<algorithm> #include<cmath> #define ll long long using namespace std; ; ; struct edge{ int to; int nxt; }; ],col[maxn]; int cnt,head[maxn];…