Language: C++

#include <bits/stdc++.h>
#include <queue>
#define ll long long int
#define inf 3e18+1
#define all(v) (v).begin(),(v).end() 
#define N 200005
#define F first
#define S second
using namespace std;
ll mod=1e9+7;
ll parent[200005],size[200005];
ll find(ll x){
    if(x==parent[x]) return x;
    return parent[x]=find(parent[x]);
}
void join(ll x,ll y) {
    ll a=find(x);
    ll b=find(y);
    if(a!=b) {
        if(size[a]<=size[b]) {
            swap(a,b);
        }
        parent[b]=parent[a];
        size[a]+=size[b];
    }
}
int main()
{
    // added the two lines below 
    ios_base::sync_with_stdio (false); 
    cin.tie(NULL);
    cout.tie(0);    
    ll test=1;//cin>>test;
    while(test--){
        ll n,m;
        cin>>n>>m;
        for(int i=1;i<=n;i++){
            parent[i]=i;
            size[i]=1;
        }
        while(m--){
            ll u,v;
            cin>>u>>v;
            join(u,v);
        }
        ll 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 join(long long int, long long int)':
a.cc:20:12: error: reference to 'size' is ambiguous
   20 |         if(size[a]<=size[b]) {
      |            ^~~~
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:19: note:                 'long long int size [200005]'
   11 | ll parent[200005],size[200005];
      |                   ^~~~
a.cc:20:21: error: reference to 'size' is ambiguous
   20 |         if(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:11:19: note:                 'long long int size [200005]'
   11 | ll parent[200005],size[200005];
      |                   ^~~~
a.cc:24:9: error: reference to 'size' is ambiguous
   24 |         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:11:19: note:                 'long long int size [200005]'
   11 | ll parent[200005],size[200005];
      |                   ^~~~
a.cc:24:18: error: reference to 'size' is ambiguous
   24 |         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:11:19: note:                 'long long int size [200005]'
   11 | ll parent[200005],size[200005];
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:39:13: error: reference to 'size' is ambiguous
   39 |             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:19: note:                 'long long int size [200005]'
   11 | ll parent[200005],size[200005];
      |                   ^~~~
a.cc:48:25: error: reference to 'size' is ambiguous
   48 |             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:11:19: note:                 'long long int size [200005]'
   11 | ll parent[200005],size[200005];
      |                   ^~~~