Language: C++

// Author : Mohamed sameh
#include <bits/stdc++.h>
typedef long long ll ;
#define pb push_back
#define f first
#define s second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SZ(a) (int)a.size()
#define Flush fflush(stdout);
using namespace std ;
const int N = 2e5+9;
int n, m, par[N], size[N];
int get_par(int u)
{
	return par[u] == u? u: par[u] = get_par(par[u]);
}
void uni(int u, int v)
{
	u = get_par(u);
	v = get_par(v);
	if (u == v)return; 
	par[u] = v;
	size[v] += size[u];
}
int main()
{
	cin >> n >> m;
	for (int i = 0; i < n; i++)
	{
		par[i] = i;
		size[i] = 1; 
	}
	for (int i = 0; i < m; i++)
	{
		int u, v;
		cin >> u >> v;
		u--;v--;
		uni(u, v);
	}
	int ans = 0;
	for (int i = 0; i < n; i++)ans = max(ans, size[get_par(i)]); 
	cout << ans <<"\n";
}


Compiler output:
a.cc: In function 'void uni(int, int)':
a.cc:24:9: error: reference to 'size' is ambiguous
   24 |         size[v] += size[u];
      |         ^~~~
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:2:
/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:13:19: note:                 'int size [200009]'
   13 | int n, m, par[N], size[N];
      |                   ^~~~
a.cc:24:20: error: reference to 'size' is ambiguous
   24 |         size[v] += size[u];
      |                    ^~~~
/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:13:19: note:                 'int size [200009]'
   13 | int n, m, par[N], size[N];
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:32:17: error: reference to 'size' is ambiguous
   32 |                 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:13:19: note:                 'int size [200009]'
   13 | int n, m, par[N], size[N];
      |                   ^~~~
a.cc:42:51: error: reference to 'size' is ambiguous
   42 |         for (int i = 0; i < n; i++)ans = max(ans, size[get_par(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:13:19: note:                 'int size [200009]'
   13 | int n, m, par[N], size[N];
      |                   ^~~~