Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vs = vector<string>;
using pll = pair<ll, ll>;
const ll oo = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define FOR(i, a, b) for(ll i=(a); i<(b); i++)
#define FORD(i, a, b) for(ll i=ll(b)-1;i>=(a);i--)
#define TR(X) ({if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })
vl parent;
vl height;
vl size;

void init(ll n) {
    parent.resize(n);
    iota(all(parent), 0);
    height.assign(n, 0);
    size.assign(n, 1);
}

ll Find(ll x) {
    if (x != parent[x]) parent[x] = Find(parent[x]);
    return parent[x];
}

bool Union(ll x, ll y) {
    x = Find(x), y = Find(y);
    if (x == y) return false;
    if (height[x] > height[y]) { parent[y] = x;
    size[x] += size[y];}
    else {
        parent[x] = y;
        size[y] += size[x];
        if (height[x] == height[y]) height[y]++;
    }
    return true;
}

int main() {
    cin.sync_with_stdio(0);

    ll n, m;
    cin >> n >> m;
    init(n);
    ll a, b;
    FOR(i, 0, m){
        cin >> a >> b;
        a--;
        b--;
        Union(a, b);
    }
    cout << *max_element(all(size)) << endl;
}

Compiler output:
a.cc: In function 'void init(ll)':
a.cc:31:5: error: reference to 'size' is ambiguous
   31 |     size.assign(n, 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:25:4: note:                 'vl size'
   25 | vl size;
      |    ^~~~
a.cc: In function 'bool Union(ll, ll)':
a.cc:43:5: error: reference to 'size' is ambiguous
   43 |     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:25:4: note:                 'vl size'
   25 | vl size;
      |    ^~~~
a.cc:43:16: error: reference to 'size' is ambiguous
   43 |     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:25:4: note:                 'vl size'
   25 | vl size;
      |    ^~~~
a.cc:46:9: error: reference to 'size' is ambiguous
   46 |         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:25:4: note:                 'vl size'
   25 | vl size;
      |    ^~~~
a.cc:46:20: error: reference to 'size' is ambiguous
   46 |         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:25:4: note:                 'vl size'
   25 | vl size;
      |    ^~~~
a.cc: In function 'int main()':
a.cc:65:30: error: reference to 'size' is ambiguous
   65 |     cout << *max_element(all(size)) << endl;
      |                              ^~~~
a.cc:13:22: note: in definition of macro 'all'
   13 | #define all(c) begin(c),end(c)
      |                      ^
/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:25:4: note:                 'vl size'
   25 | vl size;
      |    ^~~~
a.cc:65:30: error: reference to 'size' is ambiguous
   65 |     cout << *max_element(all(size)) << endl;
      |                              ^~~~
a.cc:13:29: note: in definition of macro 'all'
   13 | #define all(c) begin(c),end(c)
      |                             ^
/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:25:4: note:                 'vl size'
   25 | vl size;
      |    ^~~~