Language: C++

#include <stdio.h>
#include<iostream>
#include<string>
#include <string.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <climits>
#include <map>
using namespace std;
int fa[200005],size[200005];
int find(int x)
{
    if(fa[x]==x) return x;
    return fa[x]=find(fa[x]);
}
int main() {
    int n,m,x,y,ans=0;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        fa[i]=i;
        size[i]=1;
    }
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        if(find(x)!=find(y))
        {
            size[fa[y]]+=size[fa[x]];
            fa[fa[x]]=fa[y];
        }
    }
    for(int i=1;i<=n;i++) ans=max(ans,size[i]);
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: reference to 'size' is ambiguous
   23 |         size[i]=1;
      |         ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/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:16: note:                 'int size [200005]'
   12 | int fa[200005],size[200005];
      |                ^~~~
a.cc:30:13: error: reference to 'size' is ambiguous
   30 |             size[fa[y]]+=size[fa[x]];
      |             ^~~~
/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:16: note:                 'int size [200005]'
   12 | int fa[200005],size[200005];
      |                ^~~~
a.cc:30:26: error: reference to 'size' is ambiguous
   30 |             size[fa[y]]+=size[fa[x]];
      |                          ^~~~
/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:16: note:                 'int size [200005]'
   12 | int fa[200005],size[200005];
      |                ^~~~
a.cc:34:39: error: reference to 'size' is ambiguous
   34 |     for(int i=1;i<=n;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:12:16: note:                 'int size [200005]'
   12 | int fa[200005],size[200005];
      |                ^~~~