Language: C++

#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define mod 1000000007

const int sz=1e5+5;
ll inf=1e15;

ll par[sz],size[sz];

int root(int i)
{
    while(i!=par[i])
    {
        par[i]=par[par[i]];
        i=par[i];
    }
 
    return i;
}
 
void unio(int x,int y)
{
    int ra=root(x);
    int rb=root(y);
    // cout<<ra<<" "<<rb<<endl;
    if(ra==rb)
        return ;
    if(size[ra]<size[rb])
        swap(ra,rb);
    par[rb]=ra;
    // ll res=size[ra]*size[rb];
    size[ra]+=size[rb];
 
    // cout<<res<<endl;
 
    // return res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t=1;
    // cin>>t;
    while(t--)
    {
        ll n,m;
        cin>>n>>m;
        for(int i=0;i<n+1;i++){
            par[i]=i;
            size[i]=1;
        }
        for(int i=0;i<m;i++){
            int u,v;
            cin>>u>>v;
            unio(u,v);

        }
        ll res=0;
        for(int i=1;i<=n;i++){
            res=max(res,size[root(i)]);
        }

        cout<<res;
    }

    return 0;
}

Compiler output:
a.cc: In function 'void unio(int, int)':
a.cc:30:8: error: reference to 'size' is ambiguous
   30 |     if(size[ra]<size[rb])
      |        ^~~~
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:10:12: note:                 'long long int size [100005]'
   10 | ll par[sz],size[sz];
      |            ^~~~
a.cc:30:17: error: reference to 'size' is ambiguous
   30 |     if(size[ra]<size[rb])
      |                 ^~~~
/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:10:12: note:                 'long long int size [100005]'
   10 | ll par[sz],size[sz];
      |            ^~~~
a.cc:34:5: error: reference to 'size' is ambiguous
   34 |     size[ra]+=size[rb];
      |     ^~~~
/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:10:12: note:                 'long long int size [100005]'
   10 | ll par[sz],size[sz];
      |            ^~~~
a.cc:34:15: error: reference to 'size' is ambiguous
   34 |     size[ra]+=size[rb];
      |               ^~~~
/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:10:12: note:                 'long long int size [100005]'
   10 | ll par[sz],size[sz];
      |            ^~~~
a.cc: In function 'int main()':
a.cc:53:13: error: reference to 'size' is ambiguous
   53 |             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:10:12: note:                 'long long int size [100005]'
   10 | ll par[sz],size[sz];
      |            ^~~~
a.cc:63:25: error: reference to 'size' is ambiguous
   63 |             res=max(res,size[root(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:10:12: note:                 'long long int size [100005]'
   10 | ll par[sz],size[sz];
      |            ^~~~