Language: C++

#include<iostream>
using namespace std;
int p[200005];
  int size[200005];
 int find(int v)
  {
if(v==p[v])
  return v;
    return p[v]=find(p[v]);
  }
  
  void uni(int a,int b)
  {
     a=find(a);
    b=find(b);
    if(a!=b)
    {   p[b]=a;
    size[a]+=size[b];
    }
    }

int main()
{
int n,m;
  cin>>n>>m;
  
    for(int i=0;i<n+1;i++)
    { 
      p[i]=i;
      size[i]=1;
    }
    
    
  int a,b;
  while(m--)
  {
  cin>>a>>b;
    uni(a,b);
  }
  int ma=0;
  for(int i=1;i<n+1;i++)
    if(ma<size[i])
      ma=size[i];
  cout<<ma<<endl;
}

Compiler output:
a.cc: In function 'void uni(int, int)':
a.cc:18:5: error: reference to 'size' is ambiguous
   18 |     size[a]+=size[b];
      |     ^~~~
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: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:4:7: note:                 'int size [200005]'
    4 |   int size[200005];
      |       ^~~~
a.cc:18:14: error: reference to 'size' is ambiguous
   18 |     size[a]+=size[b];
      |              ^~~~
/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:4:7: note:                 'int size [200005]'
    4 |   int size[200005];
      |       ^~~~
a.cc: In function 'int main()':
a.cc:30:7: error: reference to 'size' is ambiguous
   30 |       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:4:7: note:                 'int size [200005]'
    4 |   int size[200005];
      |       ^~~~
a.cc:42:11: error: reference to 'size' is ambiguous
   42 |     if(ma<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:4:7: note:                 'int size [200005]'
    4 |   int size[200005];
      |       ^~~~
a.cc:43:10: error: reference to 'size' is ambiguous
   43 |       ma=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:4:7: note:                 'int size [200005]'
    4 |   int size[200005];
      |       ^~~~