Language: C++

#include<iostream>
#include<iomanip>
#include<climits>
#include<vector>
#include<list>
#include<functional>
#include<algorithm>
#include<string>
#include<cmath>
#include<complex>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

class UnionFindTree {
	int n;
	vector<int> par;
	vector<int> rank;
	vector<set<int>> not;
public:
	UnionFindTree(int N) {
		n = N;
		par.resize(n);
		rank.resize(n);
		not.resize(n);
		REP(i, n) par[i] = i;
	}

	int root(int i) {
		if (par[i] == i) return i;
		par[i] = root(par[i]);
		return par[i];
	}

	bool same(int i, int j) {
		return root(i) == root(j);
	}

	void unite(int i, int j) {
		not[i].insert(j);
		not[j].insert(i);
		if (same(i, j)) return;
		i = root(i);
		j = root(j);
		if (rank[i] < rank[j]) {
			rank[i] = rank[j];
			par[i] = root(j);
		}
		else if (rank[i] > rank[j]) {
			rank[j] = rank[i];
			par[j] = root(i);
		}
		else {
			rank[i] += 1;
			par[i] = root(j);
		}
	}

	void block(int i, int j) {
		if (same(i, j)) {
			not[i].insert(j);
			not[j].insert(i);
		}
	}

	int dec(int i) {
		return not[i].size();
	}
};

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N, M, K;
	cin >> N >> M >> K;
	UnionFindTree uft(N + 1);
	REP(i, M) {
		int A, B;
		cin >> A >> B;
		uft.unite(A, B);
	}
	REP(i, K) {
		int C, D;
		cin >> C >> D;
		uft.block(C, D);
	}
	
	vector<int> par_same(N + 1, -1);
	FOR(i, 1, N + 1) par_same[uft.root(i)] += 1;
	FOR(i, 1, N + 1) {
		cout << par_same[uft.root(i)] - uft.dec(i) << " ";
	}
	
	return 0;
}

Compiler output:
a.cc:27:26: error: expected unqualified-id before 'not' token
   27 |         vector<set<int>> not;
      |                          ^~~
a.cc: In constructor 'UnionFindTree::UnionFindTree(int)':
a.cc:33:20: error: expected primary-expression before '.' token
   33 |                 not.resize(n);
      |                    ^
a.cc: In lambda function:
a.cc:48:23: error: expected '{' before '.' token
   48 |                 not[i].insert(j);
      |                       ^
a.cc: In member function 'void UnionFindTree::unite(int, int)':
a.cc:48:24: error: 'struct UnionFindTree::unite(int, int)::<lambda()>' has no member named 'insert'
   48 |                 not[i].insert(j);
      |                        ^~~~~~
a.cc: In lambda function:
a.cc:49:23: error: expected '{' before '.' token
   49 |                 not[j].insert(i);
      |                       ^
a.cc: In member function 'void UnionFindTree::unite(int, int)':
a.cc:49:24: error: 'struct UnionFindTree::unite(int, int)::<lambda()>' has no member named 'insert'
   49 |                 not[j].insert(i);
      |                        ^~~~~~
a.cc: In lambda function:
a.cc:69:31: error: expected '{' before '.' token
   69 |                         not[i].insert(j);
      |                               ^
a.cc: In member function 'void UnionFindTree::block(int, int)':
a.cc:69:32: error: 'struct UnionFindTree::block(int, int)::<lambda()>' has no member named 'insert'
   69 |                         not[i].insert(j);
      |                                ^~~~~~
a.cc: In lambda function:
a.cc:70:31: error: expected '{' before '.' token
   70 |                         not[j].insert(i);
      |                               ^
a.cc: In member function 'void UnionFindTree::block(int, int)':
a.cc:70:32: error: 'struct UnionFindTree::block(int, int)::<lambda()>' has no member named 'insert'
   70 |                         not[j].insert(i);
      |                                ^~~~~~
a.cc: In lambda function:
a.cc:75:30: error: expected '{' before '.' token
   75 |                 return not[i].size();
      |                              ^
a.cc: In member function 'int UnionFindTree::dec(int)':
a.cc:75:31: error: 'struct UnionFindTree::dec(int)::<lambda()>' has no member named 'size'
   75 |                 return not[i].size();
      |                               ^~~~