Language: C++

#include <bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int n,m,ans,xx,yy,x,y;
int f[N],size[N]; 

int find(int x)
{
	if (f[x]==x) return x;
	return f[x]=find(f[x]);
}

int main(){
	scanf("%d%d",&n,&m);
	for (register int i=1; i<=n; ++i) f[i]=i,size[i]=1;
	for (register int i=1; i<=m; ++i)
	{
		scanf("%d%d",&x,&y);
		xx=find(x); yy=find(y);
		if (xx!=yy)
		{
			f[xx]=yy;
			size[yy]+=size[xx];
		}
	}
	for (register int i=1; i<=n; ++i) 
	if (find(i)==i) ans=max(ans,size[i]);
	printf("%d\n",ans);
return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   15 |         for (register int i=1; i<=n; ++i) f[i]=i,size[i]=1;
      |                           ^
a.cc:15:50: error: reference to 'size' is ambiguous
   15 |         for (register int i=1; i<=n; ++i) f[i]=i,size[i]=1;
      |                                                  ^~~~
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:5:10: note:                 'int size [200005]'
    5 | int f[N],size[N];
      |          ^~~~
a.cc:16:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |         for (register int i=1; i<=m; ++i)
      |                           ^
a.cc:23:25: error: reference to 'size' is ambiguous
   23 |                         size[yy]+=size[xx];
      |                         ^~~~
/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:5:10: note:                 'int size [200005]'
    5 | int f[N],size[N];
      |          ^~~~
a.cc:23:35: error: reference to 'size' is ambiguous
   23 |                         size[yy]+=size[xx];
      |                                   ^~~~
/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:5:10: note:                 'int size [200005]'
    5 | int f[N],size[N];
      |          ^~~~
a.cc:26:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   26 |         for (register int i=1; i<=n; ++i)
      |                           ^
a.cc:27:37: error: reference to 'size' is ambiguous
   27 |         if (find(i)==i) 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:5:10: note:                 'int size [200005]'
    5 | int f[N],size[N];
      |          ^~~~