Spoj Minimum Spanning Tree

Why am i getting 90,91 score ,Why not 100
This is my code.

Do the following in union:
a = find_set(a);
b = find_set(b);
if (a != b) {
if (rank[a] < rank[b])
swap(a, b);
parent[b] = a;
if (rank[a] == rank[b])
rank[a]++;
}

What difference will it cause in terms of Time Complexity??

Using rank in merging is faster than directly merging. Sometimes it become constant too. But at max it is of O(logn)

I have also used rank in merging