Language: C++

#include<bits/stdc++.h>   
#include<tr1/unordered_map>
#define ll long long int  
#define mkp make_pair 
#define mod 1000000007 
#define maxn 100001 
#define ff first
#define ss second 
using namespace std;    
int par[2*maxn]={0},size[2*maxn]={0}; 
int find(int a){  
    if(par[a]==a) 
       return a; 
    return par[a]=find(par[a]);
}  
void merge(int a,int b){ 
      int p=find(a); 
      int q=find(b); 
      if(p!=q){  
         if(size[p]>=size[q]){  
               par[q]=p; 
               size[p]+=size[q];  
               size[q]=0;
          } 
         else{  
            par[p]=q; 
            size[q]+=size[p]; 
            size[p]=0;
           }
      }
    }
int main(){    
  ios_base::sync_with_stdio(false); 
  cin.tie(NULL);    
  int n,m,a,b; 
  cin>>n>>m; 
  for(int i=0;i<=n;++i)  
     par[i]=i,size[i]=1;  

  while(m--){  
      cin>>a>>b; 
      merge(a,b);
  }  
  int ans=0;
  for(int i=1;i<=maxn;++i){   
     ans=max(ans,size[i]);
        
    }   
  cout<<ans<<"\n";
  
  
  return 0;
}

Compiler output:
a.cc: In function 'void merge(int, int)':
a.cc:20:13: error: reference to 'size' is ambiguous
   20 |          if(size[p]>=size[q]){
      |             ^~~~
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:10:21: note:                 'int size [200002]'
   10 | int par[2*maxn]={0},size[2*maxn]={0};
      |                     ^~~~
a.cc:20:22: error: reference to 'size' is ambiguous
   20 |          if(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:10:21: note:                 'int size [200002]'
   10 | int par[2*maxn]={0},size[2*maxn]={0};
      |                     ^~~~
a.cc:22:16: error: reference to 'size' is ambiguous
   22 |                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:10:21: note:                 'int size [200002]'
   10 | int par[2*maxn]={0},size[2*maxn]={0};
      |                     ^~~~
a.cc:22:25: error: reference to 'size' is ambiguous
   22 |                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:10:21: note:                 'int size [200002]'
   10 | int par[2*maxn]={0},size[2*maxn]={0};
      |                     ^~~~
a.cc:23:16: error: reference to 'size' is ambiguous
   23 |                size[q]=0;
      |                ^~~~
/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:10:21: note:                 'int size [200002]'
   10 | int par[2*maxn]={0},size[2*maxn]={0};
      |                     ^~~~
a.cc:27:13: error: reference to 'size' is ambiguous
   27 |             size[q]+=size[p];
      |             ^~~~
/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:10:21: note:                 'int size [200002]'
   10 | int par[2*maxn]={0},size[2*maxn]={0};
      |                     ^~~~
a.cc:27:22: error: reference to 'size' is ambiguous
   27 |             size[q]+=size[p];
      |                      ^~~~
/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:10:21: note:                 'int size [200002]'
   10 | int par[2*maxn]={0},size[2*maxn]={0};
      |                     ^~~~
a.cc:28:13: error: reference to 'size' is ambiguous
   28 |             size[p]=0;
      |             ^~~~
/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:10:21: note:                 'int size [200002]'
   10 | int par[2*maxn]={0},size[2*maxn]={0};
      |                     ^~~~
a.cc: In function 'int main()':
a.cc:38:15: error: reference to 'size' is ambiguous
   38 |      par[i]=i,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:10:21: note:                 'int size [200002]'
   10 | int par[2*maxn]={0},size[2*maxn]={0};
      |                     ^~~~
a.cc:46:18: error: reference to 'size' is ambiguous
   46 |      ans=max(ans,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:10:21: note:                 'int size [200002]'
   10 | int par[2*maxn]={0},size[2*maxn]={0};
      |                     ^~~~