use 1 UnionFind, add an array to store the state of sites