Language: C++

/*input
4 10
1 2
2 1
1 2
2 1
1 2
1 3
1 4
2 3
2 4
3 4
*/
 

//this ufds implementation is for this problem: https://atcoder.jp/contests/abc177/tasks/abc177_d
#include <unordered_map>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <climits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <stdint.h>
 
using namespace std;
 
/*******  All Required define Pre-Processors and typedef Constants *******/
#define ar array
#define scd(t) scanf("%d",&t)
#define scld(t) scanf("%ld",&t)
#define sclld(t) scanf("%lld",&t)
#define scc(t) scanf("%c",&t)
#define scs(t) scanf("%s",t)
#define scf(t) scanf("%f",&t)
#define sclf(t) scanf("%lf",&t)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define tests int r; cin >> r; while(r--)
#define MP make_pair
#define PI acos(-1)
typedef pair<long long, long long> PII;
typedef pair<double, double> PDD;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int,int> MPII;
typedef set<int> SETI;
typedef multiset<int> MSETI;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int  uint64;
#define godspeed ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
 
#define M(x) ((x)%(1000000007))
 
int link[200020];
int size[200020];


int find(int x){
	while(x!=link[x]) x = link[x];
	return x;
}

bool same(int a, int b){
	return find(a)==find(b);
}

void unite(int a, int b){
	a = find(a);
	b = find(b);
	if(size[a]<size[b]){
		swap(a,b);
	}
	size[a]+=size[b];
	link[b]=a;
}





 
int main() {
	int n;
	int m;

	memset(link,0,sizeof(link));
	memset(size,0,sizeof(size));
	cin>>n>>m;

	for(int i = 1; i<=n;i++){
		link[i] = i;
	}
	for(int i = 1; i<=n; i++){
		size[i] = 1;
	}
	rep(i,m){
		int a;
		int b;
		cin>>a>>b;
		if(!same(a,b)){
			unite(a,b);
		}
		
	}

	int mi = 0;
	for(int i = 1; i<=n;i++){

		mi = max(mi,size[i]);
	}
	cout<<mi<<endl;;





}

Compiler output:
a.cc: In function 'void unite(int, int)':
a.cc:94:12: error: reference to 'size' is ambiguous
   94 |         if(size[a]<size[b]){
      |            ^~~~
In file included from /usr/include/c++/14/unordered_map:42,
                 from a.cc:17:
/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:79:5: note:                 'int size [200020]'
   79 | int size[200020];
      |     ^~~~
a.cc:94:20: error: reference to 'size' is ambiguous
   94 |         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:79:5: note:                 'int size [200020]'
   79 | int size[200020];
      |     ^~~~
a.cc:97:9: error: reference to 'size' is ambiguous
   97 |         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:79:5: note:                 'int size [200020]'
   79 | int size[200020];
      |     ^~~~
a.cc:97:18: error: reference to 'size' is ambiguous
   97 |         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:79:5: note:                 'int size [200020]'
   79 | int size[200020];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:111:16: error: reference to 'size' is ambiguous
  111 |         memset(size,0,sizeof(size));
      |                ^~~~
/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:79:5: note:                 'int size [200020]'
   79 | int size[200020];
      |     ^~~~
a.cc:111:30: error: reference to 'size' is ambiguous
  111 |         memset(size,0,sizeof(size));
      |                              ^~~~
/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:79:5: note:                 'int size [200020]'
   79 | int size[200020];
      |     ^~~~
a.cc:118:17: error: reference to 'size' is ambiguous
  118 |                 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:79:5: note:                 'int size [200020]'
   79 | int size[200020];
      |     ^~~~
a.cc:133:29: error: reference to 'size' is ambiguous
  133 |                 mi = max(mi,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:79:5: note:                 'int size [200020]'
   79 | int size[200020];
      |     ^~~~