Language: C++

#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<vector>
#include<set>
#include<queue>
#include<iostream>
#include<map>
#include<cstring>
#define INF 0x3f3f3f3f
#define eps 1e-10
using namespace std;
set<int> groupc;
int n,m,root[200005],size[200005],a,b,ans;
int find(int x){
    if(root[x]==x)
        return x;
    return root[x]=find(root[x]);
}
bool same(int x,int y){
    return find(x)==find(y);
}
void merge(int x,int y){
    x=find(x);
    y=find(y);
    if(size[x]<size[y])
        swap(x,y);
    size[x]+=size[y];
    root[y]=x;
}
int main(){
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++){
        root[i]=i;
        size[i]=1;
    }
    for(int i=1;i<=m;i++){
        scanf("%d%d",&a,&b);
        if(!same(a,b))
            merge(a,b);
    }
    for(int i=1;i<=n;i++){
        groupc.insert(find(i));
    }
    for(auto e:groupc){
        ans=max(size[e],ans);
    }
    printf("%d",ans);
}


Compiler output:
a.cc: In function 'void merge(int, int)':
a.cc:27:8: error: reference to 'size' is ambiguous
   27 |     if(size[x]<size[y])
      |        ^~~~
In file included from /usr/include/c++/14/vector:69,
                 from a.cc:5:
/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:15:22: note:                 'int size [200005]'
   15 | int n,m,root[200005],size[200005],a,b,ans;
      |                      ^~~~
a.cc:27:16: error: reference to 'size' is ambiguous
   27 |     if(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:15:22: note:                 'int size [200005]'
   15 | int n,m,root[200005],size[200005],a,b,ans;
      |                      ^~~~
a.cc:29:5: error: reference to 'size' is ambiguous
   29 |     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:15:22: note:                 'int size [200005]'
   15 | int n,m,root[200005],size[200005],a,b,ans;
      |                      ^~~~
a.cc:29:14: error: reference to 'size' is ambiguous
   29 |     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:15:22: note:                 'int size [200005]'
   15 | int n,m,root[200005],size[200005],a,b,ans;
      |                      ^~~~
a.cc: In function 'int main()':
a.cc:36:9: error: reference to 'size' is ambiguous
   36 |         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:15:22: note:                 'int size [200005]'
   15 | int n,m,root[200005],size[200005],a,b,ans;
      |                      ^~~~
a.cc:47:17: error: reference to 'size' is ambiguous
   47 |         ans=max(size[e],ans);
      |                 ^~~~
/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:15:22: note:                 'int size [200005]'
   15 | int n,m,root[200005],size[200005],a,b,ans;
      |                      ^~~~