Language: C++

#include <bits/stdc++.h>

using namespace std;

#define mod 1000000007
#define int int64_t
#define fio ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"

const int maxn=2e5+5;
int par[maxn],size[maxn];
int ans;

int parent(int a)
{
    if(par[a]==a)
        return a;
    return par[a]=parent(par[a]);
}

void unionab(int a,int b)
{
    int pa=parent(a),pb=parent(b);
    if(pa==pb)
        return;
    if(size[pa]<size[pb])
        swap(pa,pb);
    par[pb]=pa;
    size[pa]+=size[pb];
    ans=max(ans,size[pa]);
}


void solve()
{
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;i++)
        par[i]=i,size[i]=1;

    ans=0;
    for(int i=0;i<m;i++)
    {
        int u,v;
        cin>>u>>v;
        unionab(u,v);
    }
    
    cout<<ans<<endl;
}

int32_t main()
{
    fio;
    int t;
    // cin>>t;
    t=1;
    while(t--)
        solve();
}

Compiler output:
a.cc: In function 'void unionab(int64_t, int64_t)':
a.cc:26:8: error: reference to 'size' is ambiguous
   26 |     if(size[pa]<size[pb])
      |        ^~~~
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:11:15: note:                 'int64_t size [200005]'
   11 | int par[maxn],size[maxn];
      |               ^~~~
a.cc:26:17: error: reference to 'size' is ambiguous
   26 |     if(size[pa]<size[pb])
      |                 ^~~~
/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:11:15: note:                 'int64_t size [200005]'
   11 | int par[maxn],size[maxn];
      |               ^~~~
a.cc:29:5: error: reference to 'size' is ambiguous
   29 |     size[pa]+=size[pb];
      |     ^~~~
/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:11:15: note:                 'int64_t size [200005]'
   11 | int par[maxn],size[maxn];
      |               ^~~~
a.cc:29:15: error: reference to 'size' is ambiguous
   29 |     size[pa]+=size[pb];
      |               ^~~~
/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:11:15: note:                 'int64_t size [200005]'
   11 | int par[maxn],size[maxn];
      |               ^~~~
a.cc:30:17: error: reference to 'size' is ambiguous
   30 |     ans=max(ans,size[pa]);
      |                 ^~~~
/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:11:15: note:                 'int64_t size [200005]'
   11 | int par[maxn],size[maxn];
      |               ^~~~
a.cc: In function 'void solve()':
a.cc:39:18: error: reference to 'size' is ambiguous
   39 |         par[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:11:15: note:                 'int64_t size [200005]'
   11 | int par[maxn],size[maxn];
      |               ^~~~