Language: C++

#include<iostream>
#include<numeric>
#include<math.h>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<climits>
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ll long long
#define mkp make_pair
#define pll pair<ll,ll>
#define rep(i,from,to) for(int i=from;i<to;i++)
#define repd(i,from,till) for(int i=from;i>=till;i--)
#define waste ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define inf 1e9+1
#define mod 1e9+7
#define inf1 1e18+1
#define pie 3.14159265358979323846
#define N 100005
using namespace std;

int pr[200005];
int size[200005];

void make_set(){
	rep(i,0,200005){
		pr[i]=i;
		size[i]=1;
	}
}

int find_set(int a){
	if(pr[a]==a)return a;
	else return find_set(pr[a]);
}

int union_set(int a,int b){
	int p=find_set(a);
	int q=find_set(b);
	if(p!=q){
		if(size[p]<size[q])swap(p,q);
		size[p]+=size[q];
		pr[q]=p;
	}
}

int solve(){
    make_set();
	int n,m;
    cin>>n>>m;
	rep(i,0,m){
		int a,b;
		cin>>a>>b;
		a--;b--;
		union_set(a,b);
	}
	int maxi=0;
	rep(i,0,n){
		maxi=max(maxi,size[i]);
	}
	cout<<maxi<<endl;
	return 0;
}
int main(){
    waste;
    int t;
    //cin>>t;
    t=1;
    while(t--){
       	solve();
    }
}


Compiler output:
a.cc: In function 'void make_set()':
a.cc:33:17: error: reference to 'size' is ambiguous
   33 |                 size[i]=1;
      |                 ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:28:5: note:                 'int size [200005]'
   28 | int size[200005];
      |     ^~~~
a.cc: In function 'int union_set(int, int)':
a.cc:46:20: error: reference to 'size' is ambiguous
   46 |                 if(size[p]<size[q])swap(p,q);
      |                    ^~~~
/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:28:5: note:                 'int size [200005]'
   28 | int size[200005];
      |     ^~~~
a.cc:46:28: error: reference to 'size' is ambiguous
   46 |                 if(size[p]<size[q])swap(p,q);
      |                            ^~~~
/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:28:5: note:                 'int size [200005]'
   28 | int size[200005];
      |     ^~~~
a.cc:47:17: error: reference to 'size' is ambiguous
   47 |                 size[p]+=size[q];
      |                 ^~~~
/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:28:5: note:                 'int size [200005]'
   28 | int size[200005];
      |     ^~~~
a.cc:47:26: error: reference to 'size' is ambiguous
   47 |                 size[p]+=size[q];
      |                          ^~~~
/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:28:5: note:                 'int size [200005]'
   28 | int size[200005];
      |     ^~~~
a.cc:50:1: warning: no return statement in function returning non-void [-Wreturn-type]
   50 | }
      | ^
a.cc: In function 'int solve()':
a.cc:64:31: error: reference to 'size' is ambiguous
   64 |                 maxi=max(maxi,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:28:5: note:                 'int size [200005]'
   28 | int size[200005];
      |     ^~~~