Language: C++

#include <iostream>
#define MAX_N 200000

using namespace std;
typedef long long ll;

int par[MAX_N];
int node_rank[MAX_N];
int size[MAX_N];

void init(int n){
  for(int i = 0; i < n; i++) {
    par[i] = i;
    node_rank[i] = 0;
    size[i] = 1;
  }
}

int find(int x){
  if(par[x] == x)
    return x;
  else
    return par[x] = find(par[x]);
}

void unite(int x, int y){
  x = find(x);
  y = find(y);
  if(x == y) return;

  if(node_rank[x] < node_rank[y]){
    par[x] = y;
    size[y] += size[x];
  }
  else{
    par[y] = x;
    size[x] += size[y];
  }
  if(node_rank[x] == node_rank[y]) node_rank[x]++;
}

int max_member(int n){
  int maxn = 0;
  for(int i=0; i<n; ++i){
    if(par[i] == i){
      maxn = max(size[i], maxn);
    }
  }

  return maxn;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n,m;
  cin>>n>>m;
  init(n);
  int a, b;
  for(int i=0; i<m; ++i){
    cin >>a>>b;
    unite(a,b);
  }

  int ans = max_member(n);
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'void init(int)':
a.cc:15:5: error: reference to 'size' is ambiguous
   15 |     size[i] = 1;
      |     ^~~~
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:9:5: note:                 'int size [200000]'
    9 | int size[MAX_N];
      |     ^~~~
a.cc: In function 'void unite(int, int)':
a.cc:33:5: error: reference to 'size' is ambiguous
   33 |     size[y] += size[x];
      |     ^~~~
/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:9:5: note:                 'int size [200000]'
    9 | int size[MAX_N];
      |     ^~~~
a.cc:33:16: error: reference to 'size' is ambiguous
   33 |     size[y] += size[x];
      |                ^~~~
/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:9:5: note:                 'int size [200000]'
    9 | int size[MAX_N];
      |     ^~~~
a.cc:37:5: error: reference to 'size' is ambiguous
   37 |     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:9:5: note:                 'int size [200000]'
    9 | int size[MAX_N];
      |     ^~~~
a.cc:37:16: error: reference to 'size' is ambiguous
   37 |     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:9:5: note:                 'int size [200000]'
    9 | int size[MAX_N];
      |     ^~~~
a.cc: In function 'int max_member(int)':
a.cc:46:18: error: reference to 'size' is ambiguous
   46 |       maxn = max(size[i], maxn);
      |                  ^~~~
/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:9:5: note:                 'int size [200000]'
    9 | int size[MAX_N];
      |     ^~~~