如何把一开始的两个牧场区分开来啊

P1522 [USACO2.4] 牛的旅行 Cow Tours

?啥意思
by tribool4_in @ 2021-03-06 10:38:54


并查集(union set) ```c void inun(int rt) { register int i; unin[rt]=1; for(i=1; i<=n; ++i) if(cnct[rt][i]) if(!unin[i]) inun(i); } ``` 然后用```unin[i]^unin[j]```
by gheescoo @ 2021-05-02 00:59:12


@[gheescoo](/user/397548) 更好用递归父亲节点表示,我刚刚这个只是针对两个牧场
by gheescoo @ 2021-05-05 12:25:01


|