Language: C++

#include <bits/stdc++.h>
#define boost ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define M 1000000007
#define eb emplace_back
#define watch(x) cout << (#x) <<" is "<< x <<"\n";


using namespace std;
//const int N = 1e6;

const int N = 2e5 + 5;
int arr[N], size[N];

int root(int i)
{
  while(arr[i] != i)
  {
    arr[i] = arr[arr[i]];
    i = arr[i];
  }
  return i;
}

int Union(int x, int y)
{
  int rootX = root(x);
  int rootY = root(y);
  if(size[rootX] < size[rootY])
    swap(rootX, rootY);
  arr[rootY] = arr[rootX];
  if(rootX != rootY)
    size[rootX] += size[rootY];
  return max(size[rootX], size[rootY]);
}

int32_t main(){
  boost;
  int t = 1; //cin>>t;
  while(t--)
  {
    iota(arr, arr+N, 0);
    for(int i=0; i<N; i++)
      size[i] = 1;
    int n, m; cin >> n >> m;
    int ans = 0;
    while(m--)
    {
      int a, b; cin >> a >> b;
      int cnt = Union(a, b);
      ans = max(ans, cnt);
    }
    cout << ans <<"\n";
  }
}



Compiler output:
a.cc: In function 'long long int Union(long long int, long long int)':
a.cc:29:6: error: reference to 'size' is ambiguous
   29 |   if(size[rootX] < size[rootY])
      |      ^~~~
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:13:13: note:                 'long long int size [200005]'
   13 | int arr[N], size[N];
      |             ^~~~
a.cc:29:20: error: reference to 'size' is ambiguous
   29 |   if(size[rootX] < size[rootY])
      |                    ^~~~
/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:13: note:                 'long long int size [200005]'
   13 | int arr[N], size[N];
      |             ^~~~
a.cc:33:5: error: reference to 'size' is ambiguous
   33 |     size[rootX] += size[rootY];
      |     ^~~~
/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:13: note:                 'long long int size [200005]'
   13 | int arr[N], size[N];
      |             ^~~~
a.cc:33:20: error: reference to 'size' is ambiguous
   33 |     size[rootX] += size[rootY];
      |                    ^~~~
/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:13: note:                 'long long int size [200005]'
   13 | int arr[N], size[N];
      |             ^~~~
a.cc:34:14: error: reference to 'size' is ambiguous
   34 |   return max(size[rootX], size[rootY]);
      |              ^~~~
/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:13: note:                 'long long int size [200005]'
   13 | int arr[N], size[N];
      |             ^~~~
a.cc:34:27: error: reference to 'size' is ambiguous
   34 |   return max(size[rootX], size[rootY]);
      |                           ^~~~
/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:13: note:                 'long long int size [200005]'
   13 | int arr[N], size[N];
      |             ^~~~
a.cc: In function 'int32_t main()':
a.cc:44:7: error: reference to 'size' is ambiguous
   44 |       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:13: note:                 'long long int size [200005]'
   13 | int arr[N], size[N];
      |             ^~~~