Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 0x3f3f3f3f

const int maxn=2e5+5;
int parent[maxn],size[maxn];
int find(int u)
{
    if(parent[u]==u) return u;
    return parent[u]=find(parent[u]);
}
void merge(int u,int v)
{
    int ru=find(u),rv=find(v);
    if(ru==rv) return;
    parent[ru]=rv;
    size[rv]+=size[ru];
}
int main(void)
{
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;++i) parent[i]=i,size[i]=1;
    for(int i=0;i<m;++i)
    {
        int a,b;
        cin>>a>>b;
        merge(a,b);
    }
    int ans=0;
    for(int i=1;i<=n;++i) ans=max(ans,size[find(i)]);
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'void merge(int, int)':
a.cc:18:5: error: reference to 'size' is ambiguous
   18 |     size[rv]+=size[ru];
      |     ^~~~
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:7:18: note:                 'int size [200005]'
    7 | int parent[maxn],size[maxn];
      |                  ^~~~
a.cc:18:15: error: reference to 'size' is ambiguous
   18 |     size[rv]+=size[ru];
      |               ^~~~
/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:7:18: note:                 'int size [200005]'
    7 | int parent[maxn],size[maxn];
      |                  ^~~~
a.cc: In function 'int main()':
a.cc:24:39: error: reference to 'size' is ambiguous
   24 |     for(int i=1;i<=n;++i) parent[i]=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:7:18: note:                 'int size [200005]'
    7 | int parent[maxn],size[maxn];
      |                  ^~~~
a.cc:32:39: error: reference to 'size' is ambiguous
   32 |     for(int i=1;i<=n;++i) ans=max(ans,size[find(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:7:18: note:                 'int size [200005]'
    7 | int parent[maxn],size[maxn];
      |                  ^~~~