Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const int MAX_N = 1e5 + 5;
const int MAX_L = 20; // ~ Log N
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 7;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;

#define watch(x) cerr << "\n" << (#x) << " is " << (x) << endl
#define LSOne(S) (S & (-S))
#define isBitSet(S, i) ((S >> i) & 1)

void add_self(int &a,int b)
{
	a+=b;
	a%=MOD;
}
int parent[MAX_N],size[MAX_N];
void make_set(int v) {
    parent[v] = v;
    size[v] = 1;
}
int find_set(int v) {
    if (v == parent[v])
        return v;
    return parent[v] = find_set(parent[v]);
}
void union_sets(int a, int b) {
    a = find_set(a);
    b = find_set(b);
    if (a != b) {
        if (size[a] < size[b])
            swap(a, b);
        parent[b] = a;
        size[a] += size[b];
    }
}
void solve() {
	int n,m;
	cin>>n>>m;
	map<int,int> mp;
	for(int i=0;i<n;i++)
	make_set(i+1);
	for(int i=0;i<m;i++)
	{
		int a,b;
		cin>>a>>b;
		union_sets(a,b);
	}
	int ans=1;
	unordered_map<int,int> m2;
	for(int i=1;i<=n;i++)
	{
		
		m2[find_set(i)]++;
		//if(mp.find(i)!=mp.end())
		ans=max(ans,m2[find_set(i)]);
	}
	cout<<ans<<endl;

}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    int tc=1; //cin >> tc;
    for (int t = 1; t <= tc; t++) {
        //cout << "Case #" << t  << ": ";
        solve();
    }
}


Compiler output:
a.cc: In function 'void make_set(int)':
a.cc:33:5: error: reference to 'size' is ambiguous
   33 |     size[v] = 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:30:19: note:                 'int size [100005]'
   30 | int parent[MAX_N],size[MAX_N];
      |                   ^~~~
a.cc: In function 'void union_sets(int, int)':
a.cc:44:13: error: reference to 'size' is ambiguous
   44 |         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:30:19: note:                 'int size [100005]'
   30 | int parent[MAX_N],size[MAX_N];
      |                   ^~~~
a.cc:44:23: error: reference to 'size' is ambiguous
   44 |         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:30:19: note:                 'int size [100005]'
   30 | int parent[MAX_N],size[MAX_N];
      |                   ^~~~
a.cc:47:9: error: reference to 'size' is ambiguous
   47 |         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:30:19: note:                 'int size [100005]'
   30 | int parent[MAX_N],size[MAX_N];
      |                   ^~~~
a.cc:47:20: error: reference to 'size' is ambiguous
   47 |         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:30:19: note:                 'int size [100005]'
   30 | int parent[MAX_N],size[MAX_N];
      |                   ^~~~