Language: C++

#include<bits/stdc++.h>
using namespace std;

// --------------------------------------------------------------------------------
#define FASTIO	ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define ll long long 
#define mset(arr,val) memset(arr,val,sizeof(arr))
#define frepi(a,b) for(int i=a;i<=b;++i)
// #define int long long
// --------------------------------------------------------------------------------
int parent[200009];
int size[200009];

int root(int x){
	while(x!=parent[x])
		x = parent[parent[x]];
	return x;
}

void union1(int a,int b){
	int pa = root(a);
	int pb = root(b);

	if(pa==pb)return;

	if(size[pa]<=size[pb]){
		parent[pa] = parent[pb];
		size[pb]+=size[pa];
	}
	else{
		parent[pb] = parent[pa];
		size[pa]+=size[pb];
	}
}

void test_case(int tc)
{
	int n,m;cin>>n>>m;
	iota(parent,parent+n,0);
	for(int i=0;i<n+2;++i)size[i]=1;
	int ans = -1;
	for(int i=0;i<m;++i){
		int u,v;cin>>u>>v;
		union1(u,v);
	}
	for(int i=0;i<n+2;++i){
		ans = max(ans,size[i]);
	}
	cout<<ans;
}

int32_t main()
{
	FASTIO;
	#ifndef ONLINE_JUDGE
		freopen("/home/suryakant/input.txt","r",stdin);
		freopen("/home/suryakant/output.txt","w",stdout);
	#endif
	
    int tc=1;
    //cin>>tc;
    for(int i=1;i<=tc;++i)test_case(tc);
}

Compiler output:
a.cc: In function 'void union1(int, int)':
a.cc:26:12: error: reference to 'size' is ambiguous
   26 |         if(size[pa]<=size[pb]){
      |            ^~~~
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:12:5: note:                 'int size [200009]'
   12 | int size[200009];
      |     ^~~~
a.cc:26:22: error: reference to 'size' is ambiguous
   26 |         if(size[pa]<=size[pb]){
      |                      ^~~~
/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:12:5: note:                 'int size [200009]'
   12 | int size[200009];
      |     ^~~~
a.cc:28:17: error: reference to 'size' is ambiguous
   28 |                 size[pb]+=size[pa];
      |                 ^~~~
/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:12:5: note:                 'int size [200009]'
   12 | int size[200009];
      |     ^~~~
a.cc:28:27: error: reference to 'size' is ambiguous
   28 |                 size[pb]+=size[pa];
      |                           ^~~~
/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:12:5: note:                 'int size [200009]'
   12 | int size[200009];
      |     ^~~~
a.cc:32:17: error: reference to 'size' is ambiguous
   32 |                 size[pa]+=size[pb];
      |                 ^~~~
/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:12:5: note:                 'int size [200009]'
   12 | int size[200009];
      |     ^~~~
a.cc:32:27: error: reference to 'size' is ambiguous
   32 |                 size[pa]+=size[pb];
      |                           ^~~~
/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:12:5: note:                 'int size [200009]'
   12 | int size[200009];
      |     ^~~~
a.cc: In function 'void test_case(int)':
a.cc:40:31: error: reference to 'size' is ambiguous
   40 |         for(int i=0;i<n+2;++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:12:5: note:                 'int size [200009]'
   12 | int size[200009];
      |     ^~~~
a.cc:47:31: error: reference to 'size' is ambiguous
   47 |                 ans = max(ans,size[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:12:5: note:                 'int size [200009]'
   12 | int size[200009];
      |     ^~~~