Language: C++

#include <bits/stdc++.h> 
using namespace std; 

const int N = 200005; int parent[N]; int size[N];

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

void unite(int a, int b) {
	a = find(a); b = find(b);
	if (a == b) return;
	if (size[a] < size[b]) swap(a, b);
	size[a] += size[b];
	parent[b] = a;
}

int main() {
    int n, m; cin >> n >> m; 
    for (int i = 0; i < N; i ++) parent[i] = i;
    for (int i = 0; i < N; i ++) size[i] = 1;
    for (int i = 0; i < m; i ++) {
        int a, b; cin >> a >> b; a--; b--;
        unite(a, b);
    } int maxsize = size[0]; for (int i = 0; i < n; i ++) maxsize = max(maxsize, size[i]);
    cout << maxsize << endl;
}

Compiler output:
a.cc: In function 'void unite(int, int)':
a.cc:14:13: error: reference to 'size' is ambiguous
   14 |         if (size[a] < size[b]) swap(a, b);
      |             ^~~~
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:4:42: note:                 'int size [200005]'
    4 | const int N = 200005; int parent[N]; int size[N];
      |                                          ^~~~
a.cc:14:23: error: reference to 'size' is ambiguous
   14 |         if (size[a] < size[b]) swap(a, 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:4:42: note:                 'int size [200005]'
    4 | const int N = 200005; int parent[N]; int size[N];
      |                                          ^~~~
a.cc:15:9: error: reference to 'size' is ambiguous
   15 |         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:4:42: note:                 'int size [200005]'
    4 | const int N = 200005; int parent[N]; int size[N];
      |                                          ^~~~
a.cc:15:20: error: reference to 'size' is ambiguous
   15 |         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:4:42: note:                 'int size [200005]'
    4 | const int N = 200005; int parent[N]; int size[N];
      |                                          ^~~~
a.cc: In function 'int main()':
a.cc:22:34: error: reference to 'size' is ambiguous
   22 |     for (int i = 0; i < N; i ++) 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:4:42: note:                 'int size [200005]'
    4 | const int N = 200005; int parent[N]; int size[N];
      |                                          ^~~~
a.cc:26:21: error: reference to 'size' is ambiguous
   26 |     } int maxsize = size[0]; for (int i = 0; i < n; i ++) maxsize = max(maxsize, size[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:4:42: note:                 'int size [200005]'
    4 | const int N = 200005; int parent[N]; int size[N];
      |                                          ^~~~
a.cc:26:82: error: reference to 'size' is ambiguous
   26 |     } int maxsize = size[0]; for (int i = 0; i < n; i ++) maxsize = max(maxsize, size[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:4:42: note:                 'int size [200005]'
    4 | const int N = 200005; int parent[N]; int size[N];
      |                                          ^~~~