Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define debug(x) cout<<#x<<": "<<x<<endl

#define all(x) x.begin(),x.end()
typedef pair<int,int> P;
typedef pair<int,P> PP;

#define MAX_N 100006
int n,m;
int k;
int a[100006];
int b[100006];
int c[100006];
int fnum[100006];
int d[100006];
int par[MAX_N];
int rank[MAX_N];
int nfnum[100006];
void init(int n)
{
	rep(i,n)
	{
		par[i]=i;
		rank[i]=0;
	}
}
int find(int x)
{
	if(par[x]==x)return x;
	else return par[x]=find(par[x]);
}
void unite(int x,int y)
{
	x=find(x);y=find(y);
	if(x==y) return;
	if(rank[x]<rank[y])par[x]=y;
	else
	{
		par[y]=x;
		if(rank[x]==rank[y])rank[x]++;
	}
}
bool same(int x,int y)
{
	return find(x)==find(y);
}
vector<int> blo[100006];
int bnum[100006];
int Mnum[100006];
int main()
{
	cin>>n>>m>>k;
	rep(i,m)
	{
		cin>>a[i]>>b[i];a[i]--;b[i]--;
		nfnum[a[i]]++;nfnum[b[i]]++;
	}
	rep(i,k){
		
		cin>>c[i]>>d[i];
		c[i]--;d[i]--;
	}
	init(n);
	rep(i,m)
	{
		unite(a[i],b[i]);
	}
	rep(i,n)find(i);
	rep(i,k)
	{
		if(same(c[i],d[i]))
		{
			bnum[c[i]]++;bnum[d[i]]++;
		}
	}
	rep(i,n)
	{
		Mnum[par[i]]++;
	}
	rep(i,n)
	{
		fnum[i]=Mnum[par[i]];
	}
	rep(i,n)
	{
		cout<<fnum[i]-bnum[i]-nfnum[i]-1;
		if(i==n-1)cout<<endl;
		else cout<<' ';
	}
	return  0;
}

Compiler output:
a.cc: In function 'void init(int)':
a.cc:38:17: error: reference to 'rank' is ambiguous
   38 |                 rank[i]=0;
      |                 ^~~~
In file included from /usr/include/c++/14/bits/move.h:37,
                 from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:31:5: note:                 'int rank [100006]'
   31 | int rank[MAX_N];
      |     ^~~~
a.cc: In function 'void unite(int, int)':
a.cc:50:12: error: reference to 'rank' is ambiguous
   50 |         if(rank[x]<rank[y])par[x]=y;
      |            ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:31:5: note:                 'int rank [100006]'
   31 | int rank[MAX_N];
      |     ^~~~
a.cc:50:20: error: reference to 'rank' is ambiguous
   50 |         if(rank[x]<rank[y])par[x]=y;
      |                    ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:31:5: note:                 'int rank [100006]'
   31 | int rank[MAX_N];
      |     ^~~~
a.cc:54:20: error: reference to 'rank' is ambiguous
   54 |                 if(rank[x]==rank[y])rank[x]++;
      |                    ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:31:5: note:                 'int rank [100006]'
   31 | int rank[MAX_N];
      |     ^~~~
a.cc:54:29: error: reference to 'rank' is ambiguous
   54 |                 if(rank[x]==rank[y])rank[x]++;
      |                             ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:31:5: note:                 'int rank [100006]'
   31 | int rank[MAX_N];
      |     ^~~~
a.cc:54:37: error: reference to 'rank' is ambiguous
   54 |                 if(rank[x]==rank[y])rank[x]++;
      |                                     ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:31:5: note:                 'int rank [100006]'
   31 | int rank[MAX_N];
      |     ^~~~