摘要:
poj 1330 裸LCA#define M 10005int parent[M]; // 根节点int Find(int i){ int j; for(j = i; j != parent[j]; j = parent[j]); while(i != j){ int temp = parent[i]; parent[i] = j; i = temp; } return j;}void Union(int a, int b){ int x = Find(a), y = Find(b); if(x == y) return... 阅读全文