Language: C++

#include<bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
typedef long long LL;
typedef pair<int,int> PII;
#define X first
#define Y second
inline int read()
{
	int x=0,f=1;char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=x*10+c-'0';c=getchar();}
	return x*f;
}
const int maxn=200010;
int n,m,f[maxn],size[maxn],ans,a,b;
int getf(int x){return f[x]==x ? x : f[x]=getf(f[x]);}
void merge(int x,int y)
{
	int a=getf(x),b=getf(y);
	if(a!=b)
	{
		f[a]=b;
		size[b]+=size[a];
	}
}
int main()
{
	n=read();m=read();
	for(int i=1;i<=n;i++)f[i]=i,size[i]=1;
	while(m--)a=read(),b=read(),merge(a,b);
	for(int i=1;i<=n;i++)ans=max(ans,size[getf(f[i])]);
	printf("%d\n",ans);
	return 0;
}
/*

*/


Compiler output:
a.cc: In function 'void merge(int, int)':
a.cc:24:17: error: reference to 'size' is ambiguous
   24 |                 size[b]+=size[a];
      |                 ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:16:17: note:                 'int size [200010]'
   16 | int n,m,f[maxn],size[maxn],ans,a,b;
      |                 ^~~~
a.cc:24:26: error: reference to 'size' is ambiguous
   24 |                 size[b]+=size[a];
      |                          ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:16:17: note:                 'int size [200010]'
   16 | int n,m,f[maxn],size[maxn],ans,a,b;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:30:37: error: reference to 'size' is ambiguous
   30 |         for(int i=1;i<=n;i++)f[i]=i,size[i]=1;
      |                                     ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:16:17: note:                 'int size [200010]'
   16 | int n,m,f[maxn],size[maxn],ans,a,b;
      |                 ^~~~
a.cc:32:42: error: reference to 'size' is ambiguous
   32 |         for(int i=1;i<=n;i++)ans=max(ans,size[getf(f[i])]);
      |                                          ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:16:17: note:                 'int size [200010]'
   16 | int n,m,f[maxn],size[maxn],ans,a,b;
      |                 ^~~~