Language: C++

#include <bits/stdc++.h>
using namespace std;
# define ll  long long
	
	int parent[200001];
	int size[200001];
	vector<pair<int,int>>v;
	int n;
	int m;
	int get_parent(int x){
		if(parent[x]==x){
			return x;
		}
		return parent[x]=get_parent(parent[x]);
	}
	void merge(int x,int y){
		int a=get_parent(x);
		int b= get_parent(y);
		if(a==b){
			return;
		}
		size[b]=size[a]+size[b];
		parent[a]=b;
	}
	int main() {

		#ifndef ONLINE_JUDGE
	        freopen("input.txt","r",stdin);
	        // freopen("output.txt","w",stdout);
	    #endif
	    ios::sync_with_stdio(false);
	    cin.tie(0);
	    cout.tie(0);  
	   
	    cin>>n;
	
	    cin>>m;
	    for(int i=0;i<m;i++){
	    	int x,y; cin>>x>>y;
	    	v.push_back({x,y});
	    }
	    // make n -set

	    for(int i=0;i<n;i++){
	    	parent[i]=i;
	    	size[i]=1;
	    }
	 
	    for(int i=0;i<m;i++){
	    	int a=v[i].first;
	    	int b=v[i].second;

	    	if(get_parent(a)!=get_parent(b)){
	    		merge(a,b);
	    	}
	    }

	    int ans=0;
	    int sans=1;
	    for(int i=0;i<n;i++){
	    	if(get_parent(i)==i){
	    		ans++;
	
	    		sans=max(size[i],sans);
	    	}
	    }
	    cout<<sans<<endl;
	    // cout<<ans<<endl;

	}



	


Compiler output:
a.cc: In function 'void merge(int, int)':
a.cc:22:17: error: reference to 'size' is ambiguous
   22 |                 size[b]=size[a]+size[b];
      |                 ^~~~
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:6:13: note:                 'int size [200001]'
    6 |         int size[200001];
      |             ^~~~
a.cc:22:25: error: reference to 'size' is ambiguous
   22 |                 size[b]=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:6:13: note:                 'int size [200001]'
    6 |         int size[200001];
      |             ^~~~
a.cc:22:33: error: reference to 'size' is ambiguous
   22 |                 size[b]=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:6:13: note:                 'int size [200001]'
    6 |         int size[200001];
      |             ^~~~
a.cc: In function 'int main()':
a.cc:46:17: error: reference to 'size' is ambiguous
   46 |                 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:6:13: note:                 'int size [200001]'
    6 |         int size[200001];
      |             ^~~~
a.cc:64:34: error: reference to 'size' is ambiguous
   64 |                         sans=max(size[i],sans);
      |                                  ^~~~
/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:6:13: note:                 'int size [200001]'
    6 |         int size[200001];
      |             ^~~~