Language: C++

#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

const int MAX = 2e5 + 5;
int par[MAX], size[MAX];
void init(int n) {
	for(int i = 0; i <= n; i++) {
		par[i] = i;
		size[i] = 1;
	}
}
int find_parent(int a)
{
	if(a == par[a]) return a;
	return par[a] = find_parent(par[a]);
}
void union_sets(int a, int b)
{
	a = find_parent(a);
	b = find_parent(b);
	if(a != b) {
		if(size[a] < size[b])
			swap(a, b);
		par[b] = a;
		size[a] += size[b];
	}
}

int main()
{
	boost;
	int n, m, i, a, b;
	cin >> n >> m;
	init(n);
	
	fo(i, 0, m) {
		cin >> a >> b;
		union_sets(a, b);
	}
	
	int ans = 0;
	foe(i, 1, n)
	ans = max(ans, size[find_parent(i)]);
	cout << ans;
}


Compiler output:
a.cc: In function 'void init(int)':
a.cc:30:17: error: reference to 'size' is ambiguous
   30 |                 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:26:15: note:                 'int size [200005]'
   26 | int par[MAX], size[MAX];
      |               ^~~~
a.cc: In function 'void union_sets(int, int)':
a.cc:43:20: error: reference to 'size' is ambiguous
   43 |                 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:26:15: note:                 'int size [200005]'
   26 | int par[MAX], size[MAX];
      |               ^~~~
a.cc:43:30: error: reference to 'size' is ambiguous
   43 |                 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:26:15: note:                 'int size [200005]'
   26 | int par[MAX], size[MAX];
      |               ^~~~
a.cc:46:17: error: reference to 'size' is ambiguous
   46 |                 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:26:15: note:                 'int size [200005]'
   26 | int par[MAX], size[MAX];
      |               ^~~~
a.cc:46:28: error: reference to 'size' is ambiguous
   46 |                 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:26:15: note:                 'int size [200005]'
   26 | int par[MAX], size[MAX];
      |               ^~~~
a.cc: In function 'int main()':
a.cc:64:24: error: reference to 'size' is ambiguous
   64 |         ans = max(ans, size[find_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:26:15: note:                 'int size [200005]'
   26 | int par[MAX], size[MAX];
      |               ^~~~