Language: C++

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define f first
#define s second
#define inf 1e15

#define N 300005

string s;
ll n,m,x,y,d,k;
ll a[N];

ll size[N];
ll parent[N];

ll find(int g)
{
    if(parent[g]!=g)
    parent[g]=find(parent[g]);
    return parent[g];
}
int main() {
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    
	int t=1;
	//cin>>t;
	while(t--){
	    
	    
	    cin>>n>>m;
	    
	   for(int i=0;i<n;i++)
	   {
		parent[i]=i;
		size[i]=1;
	   }
	   for(int i=0;i<m;i++)
	   {
		ll x,y;
		cin>>x>>y;
		x--;y--;
		x=find(x);
		y=find(y);
		if(x==y)
			continue;
		parent[x]=y;
		size[y]+=size[x];
	    }
	    ll ans=0;
	    for(int i=0;i<n;i++)
	    {
	        ans=max(ans,size[find(i)]);
		// cout<<size[find(i)]-1<<" ";
	    }
	    
	    
	    
	    
	    
	    cout<<ans<<"\n";
	    
	    
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: reference to 'size' is ambiguous
   39 |                 size[i]=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:15:4: note:                 'long long int size [300005]'
   15 | ll size[N];
      |    ^~~~
a.cc:51:17: error: reference to 'size' is ambiguous
   51 |                 size[y]+=size[x];
      |                 ^~~~
/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:15:4: note:                 'long long int size [300005]'
   15 | ll size[N];
      |    ^~~~
a.cc:51:26: error: reference to 'size' is ambiguous
   51 |                 size[y]+=size[x];
      |                          ^~~~
/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:15:4: note:                 'long long int size [300005]'
   15 | ll size[N];
      |    ^~~~
a.cc:56:29: error: reference to 'size' is ambiguous
   56 |                 ans=max(ans,size[find(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:15:4: note:                 'long long int size [300005]'
   15 | ll size[N];
      |    ^~~~