Language: C++

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


/*int cnt,head[N];
struct edge{int next,to;}e[N<<1];
inline add(int u,int v)
{
	cnt++;
	e[cnt].next=head[u];
	e[cnt].to=v;
	head[u]=cnt;
}   */
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:26:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   26 |         for (register int i=1; i<=n; ++i) f[i]=i,size[i]=1;
      |                           ^
a.cc:26:50: error: reference to 'size' is ambiguous
   26 |         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:16:10: note:                 'int size [200005]'
   16 | int f[N],size[N];
      |          ^~~~
a.cc:27:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   27 |         for (register int i=1; i<=m; ++i)
      |                           ^
a.cc:34:25: error: reference to 'size' is ambiguous
   34 |                         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:16:10: note:                 'int size [200005]'
   16 | int f[N],size[N];
      |          ^~~~
a.cc:34:35: error: reference to 'size' is ambiguous
   34 |                         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:16:10: note:                 'int size [200005]'
   16 | int f[N],size[N];
      |          ^~~~
a.cc:37:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   37 |         for (register int i=1; i<=n; ++i)
      |                           ^
a.cc:38:37: error: reference to 'size' is ambiguous
   38 |         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:16:10: note:                 'int size [200005]'
   16 | int f[N],size[N];
      |          ^~~~