Language: C++

#include<iostream>
using namespace std;
int parent[200005];
int size[200005];
int find(int i) {
    if(parent[i]==i)
        return i;
    else
        return parent[i]=find(parent[i]);
}
void union_set(int i,int j) {
    int x=find(i);
    int y=find(j);
    if(size[x]<size[y])swap(x,y);
    parent[y]=x;
    if(x!=y)size[x]+=size[y];
}


int main()
{
    int n,m;cin>>n>>m;
    for(int i=1;i<=n;i++){
    parent[i]=i;
    size[i]=1;
    }
    while(m--){
    int l,r;cin>>l>>r;
    union_set(l,r);
    }
    int mx=1;
    for(int i=1;i<=n;i++)
    mx=max(mx,size[find(i)]);
    cout<<mx<<endl;
    
    
    return 0;
}

Compiler output:
a.cc: In function 'void union_set(int, int)':
a.cc:14:8: error: reference to 'size' is ambiguous
   14 |     if(size[x]<size[y])swap(x,y);
      |        ^~~~
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:5: note:                 'int size [200005]'
    4 | int size[200005];
      |     ^~~~
a.cc:14:16: error: reference to 'size' is ambiguous
   14 |     if(size[x]<size[y])swap(x,y);
      |                ^~~~
/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:5: note:                 'int size [200005]'
    4 | int size[200005];
      |     ^~~~
a.cc:16:13: error: reference to 'size' is ambiguous
   16 |     if(x!=y)size[x]+=size[y];
      |             ^~~~
/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:5: note:                 'int size [200005]'
    4 | int size[200005];
      |     ^~~~
a.cc:16:22: error: reference to 'size' is ambiguous
   16 |     if(x!=y)size[x]+=size[y];
      |                      ^~~~
/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:5: note:                 'int size [200005]'
    4 | int size[200005];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:25:5: error: reference to 'size' is ambiguous
   25 |     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:5: note:                 'int size [200005]'
    4 | int size[200005];
      |     ^~~~
a.cc:33:15: error: reference to 'size' is ambiguous
   33 |     mx=max(mx,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:4:5: note:                 'int size [200005]'
    4 | int size[200005];
      |     ^~~~