Language: C++

#include <bits/stdc++.h>

using namespace std;

int parent[200005],size[200005];

void make_set(int v){
    parent[v]=v;
    size[v]=1;
}

int find_sets(int v){
    if(parent[v]==v)
    return v;
    else return parent[v]=find_sets(parent[v]);
}

void union_sets(int a,int b){
    a=find_sets(a);
    b=find_sets(b);
    if(a!=b)
    {
        if(size[a]<size[b]){
            int t=a;
            a=b;
            b=t;
        }
        size[a]+=size[b];
        parent[b]=a;
    }
}

int main()
{
    int n,m,k,u,v,ans=1;
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    make_set(i);
    while(m--)
    {
        cin>>u>>v;
        union_sets(u,v);
    }
    for(int i=1;i<=n;i++) ans=max(ans,size[parent[i]]);
    cout<<ans;
}

Compiler output:
a.cc: In function 'void make_set(int)':
a.cc:9:5: error: reference to 'size' is ambiguous
    9 |     size[v]=1;
      |     ^~~~
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:5:20: note:                 'int size [200005]'
    5 | int parent[200005],size[200005];
      |                    ^~~~
a.cc: In function 'void union_sets(int, int)':
a.cc:23:12: error: reference to 'size' is ambiguous
   23 |         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:5:20: note:                 'int size [200005]'
    5 | int parent[200005],size[200005];
      |                    ^~~~
a.cc:23:20: error: reference to 'size' is ambiguous
   23 |         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:5:20: note:                 'int size [200005]'
    5 | int parent[200005],size[200005];
      |                    ^~~~
a.cc:28:9: error: reference to 'size' is ambiguous
   28 |         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:5:20: note:                 'int size [200005]'
    5 | int parent[200005],size[200005];
      |                    ^~~~
a.cc:28:18: error: reference to 'size' is ambiguous
   28 |         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:5:20: note:                 'int size [200005]'
    5 | int parent[200005],size[200005];
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:44:39: error: reference to 'size' is ambiguous
   44 |     for(int i=1;i<=n;i++) ans=max(ans,size[parent[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:5:20: note:                 'int size [200005]'
    5 | int parent[200005],size[200005];
      |                    ^~~~