Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <algorithm>
#include <climits>
#include <iomanip>
#define endl "\n"
#define debug(x) cout << #x << " : " << x << endl;
#define debug2(x, y) cout << #x << " : " << x  << ", " << #y << " : " << y << endl;
#define FASTIO ios_base::sync_with_stdio(false),cin.tie(0);
typedef long long ll;
using namespace std;

const int maxSize = 2e5 + 5;
int parent[maxSize];
int size[maxSize];

void make_set(int v)
{
	parent[v] = v;
	size[v] = 1;
}

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

void union_set(int a, int b)
{
	a = find(a);
	b = find(b);

	if(a != b)
	{
		if(size[a] > size[b])
			swap(a, b);
		parent[a] = b;
		size[b] += size[a];
	}
}
int main()
{
	FASTIO

	int n, m;
	cin >> n >> m;

	for(int i = 1; i <= n; i ++)
		make_set(i);

	for(int i = 0; i < m; i ++)
	{
		int a, b;
		cin >> a >> b;
		union_set(a, b);
	}

	int count[n + 1] = {0};
	int maxm = 0;
	for(int i = 1; i <= n; i ++)	
	{
		count[parent[i]] ++;
		maxm = max(maxm, count[parent[i]]);
	}

	cout << maxm << endl;
}

Compiler output:
a.cc: In function 'void make_set(int)':
a.cc:25:9: error: reference to 'size' is ambiguous
   25 |         size[v] = 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:20:5: note:                 'int size [200005]'
   20 | int size[maxSize];
      |     ^~~~
a.cc: In function 'void union_set(int, int)':
a.cc:42:20: error: reference to 'size' is ambiguous
   42 |                 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:20:5: note:                 'int size [200005]'
   20 | int size[maxSize];
      |     ^~~~
a.cc:42:30: error: reference to 'size' is ambiguous
   42 |                 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:20:5: note:                 'int size [200005]'
   20 | int size[maxSize];
      |     ^~~~
a.cc:45:17: error: reference to 'size' is ambiguous
   45 |                 size[b] += size[a];
      |                 ^~~~
/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:20:5: note:                 'int size [200005]'
   20 | int size[maxSize];
      |     ^~~~
a.cc:45:28: error: reference to 'size' is ambiguous
   45 |                 size[b] += size[a];
      |                            ^~~~
/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:20:5: note:                 'int size [200005]'
   20 | int size[maxSize];
      |     ^~~~