Language: C++

#include <bits/stdc++.h>
#define ll long long int
using namespace std;
const ll mod=1e9 +7;
#define vi vector<int>
#define pb emplace_back
ll poww(ll n,ll x)
{
    ll res=1;
    
    while(x>0)
    {
        if(x&1)
          res*=n;
        
        x=x>>1;
        n*=n;
    }
    return res;
}

int parent[200005];
int size1[200005];
int find(int node)
{
	if(parent[node]==node)
	  return node;
	 
	return parent[node]= find(parent[node]);
}

void union1(int a,int b)
{
	a=find(a);
	b=find(b);
	
	
	if(a!=b)
	{
		 if(size1[a]<size1[b])
	      swap(a,b);
	    
	    size1[a]+= size1[b];
		parent[b]=a;
	}
	   
}


int main() 
{
	   ios::sync_with_stdio(0);
	   cin.tie(0);
	   cout.tie(0);
       
       ll n,m,x,y;
       cin>>n>>m;
       for(int i=1;i<=n;i++)
       {
       	  parent[i]=i;
       	  size1[i]=1;
       }
       
       while(m--)
       {
       	cin>>x>>y;
       //x--,y--;
       	union1(x,y);
       }
       
       map<int,int> mp1;
       for(int i=1;i<=n;i++)
       {
       	//cout<<parent[i]<<' ';
       	mp1[parent[i]]++;
       }
      // cout<<endl;
       
       ll mx=INT_MIN;
        for(auto k: mp1)
           mx=max(k.second,mx);
       cout<<mx;
//        
       
}

Compiler output:
a.cc: In function 'int main()':
a.cc:81:18: error: no matching function for call to 'max(int&, long long int&)'
   81 |            mx=max(k.second,mx);
      |               ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:81:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   81 |            mx=max(k.second,mx);
      |               ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:81:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   81 |            mx=max(k.second,mx);
      |               ~~~^~~~~~~~~~~~~