Language: C++

#include <bits/stdc++.h>
#define ll long long int 
#define endl '\n'
#define INF 1000000000
#define MOD 1000000007
#define MAX 100000000 
#define mp make_pair
#define pb push_back
using namespace std;
int parent[200001],size[200001],vis[200001];
void make_set(int v) {
    parent[v] = v;
    size[v]=1;
}

int find_set(int v) {
    if (v == parent[v])
        return v;
    return find_set(parent[v]);
}
void union_sets(int a, int b) {
    a = find_set(a);
    b = find_set(b);
    if (a != b) {
        if (size[a] < size[b])
            swap(a, b);
        parent[b] = a;
        size[a] += size[b];
    }
}
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m,u,v;
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    {
    	make_set(i);
    }
    for(int i=1;i<=m;i++)
    {
    	cin>>u>>v;
    	union_sets(u,v);
    }
    int ans=0;
    for(int i=1;i<=n;i++)
    {
    	//cout<<size[i]<<" ";
    	u=find_set(i);
    	if(!vis[u])
    	{
    		ans=max(ans,size[u]);
    		vis[u]=1;
    	}
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'void make_set(int)':
a.cc:13:5: error: reference to 'size' is ambiguous
   13 |     size[v]=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:10:20: note:                 'int size [200001]'
   10 | int parent[200001],size[200001],vis[200001];
      |                    ^~~~
a.cc: In function 'void union_sets(int, int)':
a.cc:25:13: error: reference to 'size' is ambiguous
   25 |         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:10:20: note:                 'int size [200001]'
   10 | int parent[200001],size[200001],vis[200001];
      |                    ^~~~
a.cc:25:23: error: reference to 'size' is ambiguous
   25 |         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:10:20: note:                 'int size [200001]'
   10 | int parent[200001],size[200001],vis[200001];
      |                    ^~~~
a.cc:28:9: error: reference to 'size' is ambiguous
   28 |         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:10:20: note:                 'int size [200001]'
   10 | int parent[200001],size[200001],vis[200001];
      |                    ^~~~
a.cc:28:20: error: reference to 'size' is ambiguous
   28 |         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:10:20: note:                 'int size [200001]'
   10 | int parent[200001],size[200001],vis[200001];
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:53:29: error: reference to 'size' is ambiguous
   53 |                 ans=max(ans,size[u]);
      |                             ^~~~
/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:20: note:                 'int size [200001]'
   10 | int parent[200001],size[200001],vis[200001];
      |                    ^~~~