摘要:
亲戚题:已知a和b是亲戚,a和c是亲戚,则可以判断出b和c也是亲戚。将多个集合合并成没有交集的集合。 1 #include <iostream> 2 using namespace std; 3 4 int N, M, Q; 5 int pre[20000], rak[20000]; 6 7 void MakeSet(int x) 8 { 9 pre[x] = -1;10 rak[x] = 0;11 }12 13 int FindSet(int x)14 {15 int r = x, q;16 while (pre[r] != -1)17 r... 阅读全文
posted @ 2013-06-20 11:02
月moon鸟
阅读(170)
评论(0)
推荐(0)

浙公网安备 33010602011771号