Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=2e5;
int par[N],rank[N];
int Find(int x)
{
	if(par[x]!=x) par[x]=Find(par[x]);
	return par[x];
}
void Union(int a,int b)
{
	int x=Find(a),y=Find(b);
	if(x==y) return;
	if(rank[x]<rank[y]) par[x]=y;
	else if(rank[x]>rank[y]) par[y]=x;
	else
	{
		par[y]=x;
		rank[x]++;
	}
}
int main()
{
	int n,m;
	cin>>n>>m;
	for(int i=0;i<n;i++) par[i]=i,rank[i]=0;
	for(int i=0;i<m;i++)
	{
		int a,b;
		cin>>a>>b;
		a--,b--;
		Union(a,b);
	}
	sort(par,par+n);
	int c=0,i=0;
	while(i<n)
	{
		int tc=1;
		i++;
		while(i<n&&par[i]==par[i-1]) i++,tc++;
		c=max(c,tc);
	}
	cout<<c;
	return 0;
}

Compiler output:
a.cc: In function 'void Union(int, int)':
a.cc:15:12: error: reference to 'rank' is ambiguous
   15 |         if(rank[x]<rank[y]) par[x]=y;
      |            ^~~~
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:5:12: note:                 'int rank [200000]'
    5 | int par[N],rank[N];
      |            ^~~~
a.cc:15:20: error: reference to 'rank' is ambiguous
   15 |         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:5:12: note:                 'int rank [200000]'
    5 | int par[N],rank[N];
      |            ^~~~
a.cc:16:17: error: reference to 'rank' is ambiguous
   16 |         else if(rank[x]>rank[y]) par[y]=x;
      |                 ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:5:12: note:                 'int rank [200000]'
    5 | int par[N],rank[N];
      |            ^~~~
a.cc:16:25: error: reference to 'rank' is ambiguous
   16 |         else if(rank[x]>rank[y]) par[y]=x;
      |                         ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:5:12: note:                 'int rank [200000]'
    5 | int par[N],rank[N];
      |            ^~~~
a.cc:20:17: error: reference to 'rank' is ambiguous
   20 |                 rank[x]++;
      |                 ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:5:12: note:                 'int rank [200000]'
    5 | int par[N],rank[N];
      |            ^~~~
a.cc: In function 'int main()':
a.cc:27:39: error: reference to 'rank' is ambiguous
   27 |         for(int i=0;i<n;i++) par[i]=i,rank[i]=0;
      |                                       ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:5:12: note:                 'int rank [200000]'
    5 | int par[N],rank[N];
      |            ^~~~