Language: C++

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<functional>
using namespace std;
#define ll long long int
#define ld long double
using namespace __gnu_pbds;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,
tree_order_statistics_node_update> in_set;
#define rep(n) for(ll i=0;i<(n);i++)
#define jrep(n) for(ll j=0;j<(n);j++)
#define krep(n) for(ll k=0;k<(n);k++)
#define all(a) (a).begin(), (a).end()
#define dpp(a) cout<<(a).first<<" "<<(a).second<<endl;
#define append push_back
#define mod 1000000007
#define ff first
#define ss second
#define ffast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fast ios::sync_with_stdio(0);
ll pw(ll x,ll y,ll p=mod){ll r=1; x=x%p;while(y>0){ if(y&1)r=(r*x)%p;
y=y>>1;x=(x*x)%p;} return r; } 

vector<ll> graph[200005];
bool visit[200005];
vector<ll> vrr;
void dfs(ll a){
    if(!visit[a]){
        vrr.back()++; visit[a]=true;
        for(auto i:graph[a]) dfs(i);
    }
}
void solve(ll ts){
    ll n,m; cin>>n>>m; set<ll> st;
    rep(m){
        ll a,b; cin>>a>>b; graph[a].append(b); graph[b].append(a);
    }
    rep(n){
        if(!visit[i+1]){
            vrr.append((ll)0);
            dfs(i+1);
        }
    }
    cout<<(*max_element(all(vrr)))<<endl;
} 
int main(){
    ffast
    ll t=1;
//    cin>>t;
    rep(t) solve(i+1);
}
 
 
// *p.find_by_order(n) : nth value (0 indexed)
// p.order_of_key(7): index of 7 (0 indexed)


Compiler output:
a.cc: In function 'void dfs(long long int)':
a.cc:29:9: error: reference to 'visit' is ambiguous
   29 |     if(!visit[a]){
      |         ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:26:6: note:                 'bool visit [200005]'
   26 | bool visit[200005];
      |      ^~~~~
a.cc:30:23: error: reference to 'visit' is ambiguous
   30 |         vrr.back()++; visit[a]=true;
      |                       ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:26:6: note:                 'bool visit [200005]'
   26 | bool visit[200005];
      |      ^~~~~
a.cc: In function 'void solve(long long int)':
a.cc:40:13: error: reference to 'visit' is ambiguous
   40 |         if(!visit[i+1]){
      |             ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:26:6: note:                 'bool visit [200005]'
   26 | bool visit[200005];
      |      ^~~~~