Language: C++

#include<bits/stdc++.h>

using namespace std;
int n,f[202020],size[202020];
const int mod = 1e9+7;
long long sum = 0;

inline int getf(int x) {
	if (x == f[x])
		return x;
	return f[x] = getf(f[x]);
}
int m,aa,bb;
int main() {
scanf("%d%d",&n,&m);
for (int i = 1;i <= n; i++) {
	f[i] = i;
	size[i] = 1;
}
int ans = 1;
for (int i = 1;i <= m; i++) {
	scanf("%d%d",&aa,&bb);
	if (getf(aa) != getf(bb)) {
		size[f[bb]] += size[f[aa]];
		ans = max(ans,size[f[bb]]);
		f[f[aa]] = f[bb];
	}
}
	printf("%d",ans);
	return 0;
}
/*
5
6 14 15 7 12 16 5 4 11 9 3 10 8 2 13 1
4
1 2 3 4 5 6 7 8
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: reference to 'size' is ambiguous
   18 |         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:4:17: note:                 'int size [202020]'
    4 | int n,f[202020],size[202020];
      |                 ^~~~
a.cc:24:17: error: reference to 'size' is ambiguous
   24 |                 size[f[bb]] += size[f[aa]];
      |                 ^~~~
/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:17: note:                 'int size [202020]'
    4 | int n,f[202020],size[202020];
      |                 ^~~~
a.cc:24:32: error: reference to 'size' is ambiguous
   24 |                 size[f[bb]] += size[f[aa]];
      |                                ^~~~
/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:17: note:                 'int size [202020]'
    4 | int n,f[202020],size[202020];
      |                 ^~~~
a.cc:25:31: error: reference to 'size' is ambiguous
   25 |                 ans = max(ans,size[f[bb]]);
      |                               ^~~~
/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:17: note:                 'int size [202020]'
    4 | int n,f[202020],size[202020];
      |                 ^~~~