Re: What about WA16 ?

"/*

const int maxn = 100100;

int a[maxn], b[maxn], c[maxn];

bool order[maxn];

int cnt;

int p[maxn], rank[maxn];

int find_set(int x) {

if(p[x] == x) return x;

return p[x] = find_set(p[x]);

}

int unite(int x, int y) {

x = find_set(x);

y = find_set(y);

if(x == y)

return 0;

if(rank[x] > rank[y]) {

p[y] = x;

} else {

p[x] = y;

if(rank[x] == rank[y])

rank[y] ++;

}

return 1;

}

int main() {

int n, m, q;

scanf("%d%d", &n, &m);

for (int i = 0; i < m; i ++) {

scanf("%d%d", a + i, b + i);

}

scanf("%d", &q);

for (int i = 0; i < q; i ++) {

scanf("%d", c + i);

order[--c[i]] = true;

}

for (int i = 0; i < n; i ++) p[i] = i;

cnt = n;

for (int i = 0; i < n; i ++) {

if(order[i] == false) {

cnt -= unite(a[i], b[i]);

}

}

c[q] = cnt;

for (int i = q - 1; i > 0; i --) {

cnt -= unite(a[c[i]], b[c[i]]);

c[i] = cnt;

}

for (int i = 1; i < q; i ++)

printf("%d ", c[i]);

printf("%d", c[q]);

}*/"