Language: C++

#include <bits/stdc++.h>

using namespace std;

#define MAXN 200005

int N, M;
vector<int> parent;
vector<int> size;

void init()
{
    parent.assign(N+1, 1);
    size.assign(N+1, 1);
    for (int i = 1; i <= N; i++) {
        parent[i] = i;
    }
}

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

bool same(int u, int v)
{
    return find(u) == find(v);
}

void join(int u, int v)
{
    u = find(u);
    v = find(v);
    
    if (u == v)
        return;
    
    if (size[u] > size[v])
        swap(u, v);
    
    parent[u] = v;
    size[v] += size[u];
}

int main()
{
    cin >> N >> M;
    init();
    for (int i = 0; i < M; i++) {
        int a, b;
        cin >> a >> b;
        join(a, b);
    }
    set<int, greater<int> > s;
    for (int i = 1; i <= N; i++) {
        s.insert(size[i]);
    }
    cout << *s.begin() << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:14:5: error: reference to 'size' is ambiguous
   14 |     size.assign(N+1, 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:9:13: note:                 'std::vector<int> size'
    9 | vector<int> size;
      |             ^~~~
a.cc: In function 'void join(int, int)':
a.cc:41:9: error: reference to 'size' is ambiguous
   41 |     if (size[u] > size[v])
      |         ^~~~
/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:9:13: note:                 'std::vector<int> size'
    9 | vector<int> size;
      |             ^~~~
a.cc:41:19: error: reference to 'size' is ambiguous
   41 |     if (size[u] > size[v])
      |                   ^~~~
/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:9:13: note:                 'std::vector<int> size'
    9 | vector<int> size;
      |             ^~~~
a.cc:45:5: error: reference to 'size' is ambiguous
   45 |     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:9:13: note:                 'std::vector<int> size'
    9 | vector<int> size;
      |             ^~~~
a.cc:45:16: error: reference to 'size' is ambiguous
   45 |     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:9:13: note:                 'std::vector<int> size'
    9 | vector<int> size;
      |             ^~~~
a.cc: In function 'int main()':
a.cc:59:18: error: reference to 'size' is ambiguous
   59 |         s.insert(size[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:9:13: note:                 'std::vector<int> size'
    9 | vector<int> size;
      |             ^~~~