Language: C++

#include<bits/stdc++.h>
#include<set>
using namespace std;
typedef long long ll;
vector<int> a1[100004];
vector<int> a2[100004];
int par[100004],rank[100004];
void init(int n)
{
	for(int i=1;i<=n;i++)
	{
		par[i]=i;
		rank[i]=1;
	}
}
int find(int x)
{
	if(par[x]==x)
	{
		return x;
	}
	else
	{
		return par[x]=find(par[x]);
	}
}
void unite(int x,int y)
{
//	printf("%d %d ",x,y);
	x=find(x);
	y=find(y);	
//	printf("%d %d\n",x,y);
	if(x==y)
	{
		return;
	}
	if(rank[x]>rank[y])
	{
		par[y]=x;
		rank[x]+=rank[y];
	}
	else
	{
		par[x]=y;
		rank[y]+=rank[x];
	}
}
int main()
{
	int n,m,k;
	scanf("%d%d%d",&n,&m,&k);
	init(n);
	for(int i=0;i<m;i++)
	{
		int a11,b1;
		scanf("%d%d",&a11,&b1);
		a1[a11].push_back(b1);
		a1[b1].push_back(a11);
		unite(a11,b1);
	}
	for(int i=0;i<k;i++)
	{
		int c1,d1;
		scanf("%d%d",&c1,&d1);
		a2[c1].push_back(d1);
		a2[d1].push_back(c1);
	}
	for(int i=1;i<=n;i++)
	{
//		printf("%d ",rank[find(i)]);
	}
//	printf("\n");
	for(int i=1;i<=n;i++)
	{
		int ans=rank[find(i)]-a1[i].size();
		for(int j=0;j<a2[i].size();j++)
		{
			if(find(a2[i][j])==find(i))
			{
				ans--;
			}
		}
		printf("%d ",ans-1);
	}
} 

Compiler output:
a.cc: In function 'void init(int)':
a.cc:13:17: error: reference to 'rank' is ambiguous
   13 |                 rank[i]=1;
      |                 ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:7:17: note:                 'int rank [100004]'
    7 | int par[100004],rank[100004];
      |                 ^~~~
a.cc: In function 'void unite(int, int)':
a.cc:37:12: error: reference to 'rank' is ambiguous
   37 |         if(rank[x]>rank[y])
      |            ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:7:17: note:                 'int rank [100004]'
    7 | int par[100004],rank[100004];
      |                 ^~~~
a.cc:37:20: error: reference to 'rank' is ambiguous
   37 |         if(rank[x]>rank[y])
      |                    ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:7:17: note:                 'int rank [100004]'
    7 | int par[100004],rank[100004];
      |                 ^~~~
a.cc:40:17: error: reference to 'rank' is ambiguous
   40 |                 rank[x]+=rank[y];
      |                 ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:7:17: note:                 'int rank [100004]'
    7 | int par[100004],rank[100004];
      |                 ^~~~
a.cc:40:26: error: reference to 'rank' is ambiguous
   40 |                 rank[x]+=rank[y];
      |                          ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:7:17: note:                 'int rank [100004]'
    7 | int par[100004],rank[100004];
      |                 ^~~~
a.cc:45:17: error: reference to 'rank' is ambiguous
   45 |                 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:7:17: note:                 'int rank [100004]'
    7 | int par[100004],rank[100004];
      |                 ^~~~
a.cc:45:26: error: reference to 'rank' is ambiguous
   45 |                 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:7:17: note:                 'int rank [100004]'
    7 | int par[100004],rank[100004];
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:75:25: error: reference to 'rank' is ambiguous
   75 |                 int ans=rank[find(i)]-a1[i].size();
      |                         ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:7:17: note:                 'int rank [100004]'
    7 | int par[100004],rank[100004];
      |                 ^~~~