Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef std::pair<int, int> ipair;
#define int long long
#define pb push_back
#define ff first
#define INF INT_MAX
#define ss second
#define fr(i, j, a) for (int i = j; i < a; i++)
#define cnt_ones(x) __builtin_popcount(x)
#define all(x) x.begin(), x.end()
#define endl "\n"
#define vi vector<int>
#define vvi vector<vector<int>>
#define vp vector<ipair>
#define ar array
#define IOS                                                                    \
  std::ios::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
int n, m;
vi par, size;
void make_set() {
  for (int i = 0; i < n; i++) {
    par[i] = i;
    size[i] = 1;
  }
}
int find_set(int u) {
  if (u == par[u])
    return u;
  return par[u] = find_set(par[u]);
}

void union_set(int a, int b) {
  int x = find_set(a), y = find_set(b);
  if (x != y) {
    if (size[y] > size[x])
      swap(x, y);
    par[y] = x;
    size[x] += size[y];
  }
}
void init() {
  cin >> n >> m;
  par.resize(n), size.resize(n);
  make_set();
  while (m--) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    union_set(a, b);
  }
  int mx = 1;
  for (int i = 0; i < n; i++)
    mx = max(mx, size[find_set(i)]);
  cout << mx << endl;
}
int32_t main() {
  IOS;
  init();
  return 0;
}


Compiler output:
a.cc: In function 'void make_set()':
a.cc:26:5: error: reference to 'size' is ambiguous
   26 |     size[i] = 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:22:9: note:                 'std::vector<long long int> size'
   22 | vi par, size;
      |         ^~~~
a.cc: In function 'void union_set(long long int, long long int)':
a.cc:38:9: error: reference to 'size' is ambiguous
   38 |     if (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:22:9: note:                 'std::vector<long long int> size'
   22 | vi par, size;
      |         ^~~~
a.cc:38:19: error: reference to 'size' is ambiguous
   38 |     if (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:22:9: note:                 'std::vector<long long int> size'
   22 | vi par, size;
      |         ^~~~
a.cc:41:5: error: reference to 'size' is ambiguous
   41 |     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:22:9: note:                 'std::vector<long long int> size'
   22 | vi par, size;
      |         ^~~~
a.cc:41:16: error: reference to 'size' is ambiguous
   41 |     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:22:9: note:                 'std::vector<long long int> size'
   22 | vi par, size;
      |         ^~~~
a.cc: In function 'void init()':
a.cc:46:18: error: reference to 'size' is ambiguous
   46 |   par.resize(n), size.resize(n);
      |                  ^~~~
/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:22:9: note:                 'std::vector<long long int> size'
   22 | vi par, size;
      |         ^~~~
a.cc:56:18: error: reference to 'size' is ambiguous
   56 |     mx = max(mx, size[find_set(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:22:9: note:                 'std::vector<long long int> size'
   22 | vi par, size;
      |         ^~~~