摘要: /* 说到底,还是并查集; 当然这题比较特殊;*/一般的并查集应该这么写: for(int i = 1; i #include #include #include #include #include #include #define maxn 2005 int father[maxn],sex[maxn]; using namespace std; int find(int x) //查找根 { if(father[x]==x) return x; else return father[x] = find(father[x]); } void Uni... 阅读全文
posted @ 2013-04-18 16:39 简洁是智慧的灵魂 阅读(159) 评论(0) 推荐(0)