The 17-th Beihang University Collegiate Programming Contest (BCPC 2022) - Preliminary L.逃跑路线(思维/二分图)
题目n(2#include#includeusingnamespacestd;constintN=1e6+10,mod=998244353,owt=(mod+1)/2;intn,m,k,u,v,a,b[N],sum[3],tot[3];intcol[N];vectore[N];//12二分图染色booldfs(intu,intfa,intc){col[u]=c;sum[c]=(sum[c]+b[u