Language: C++

#include<bits/stdc++.h> 
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;  
#define ordered_set tree<ll, null_type , less<ll> , rb_tree_tag , tree_order_statistics_node_update> 
#define ll long long
#define ull unsigned long long
#define pb push_back
#define inf 1e18
#define mk make_pair
#define ld long double
#define mod 998244353
#define fi first
#define se second
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define test ll t; cin>>t; while(t--)
#define setbits __builtin_popcount
#define endl '\n'
#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i));}
sim, class b dor(pair < b, c > d) {
    ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
    *this << "[";
    for (auto it = d.b; it != d.e; ++it)
        *this << ", " + 2 * (it == d.b) << *it;
    ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define maxn 200001
vector<vector<ll>>v(maxn);
vector<ll>visit(maxn);
ll val=0;
void dfs(ll x)
{
    visit[x]=1;
    val++;
    for(auto itr:v[x])
    {
        if(visit[itr]==1)
        {
            continue;
        }
        dfs(itr);
    }
}
int main()
{
    fastIO;
    ll n,m;
    cin>>n>>m;
    ll x,y;
    for(int i=0;i<m;i++)
    {
        cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);
    }
    vector<ll>vec;
    for(int i=1;i<=n;i++)
    {  
        if(visit[i]==0)
        {
            val=0;
            dfs(i);
            vec.push_back(val);
        }
    }
    sort(vec.begin(),vec.end());
    cout<<*vec.rbegin()<<endl;
}

Compiler output:
a.cc: In function 'void dfs(long long int)':
a.cc:55:5: error: reference to 'visit' is ambiguous
   55 |     visit[x]=1;
      |     ^~~~~
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:51:11: note:                 'std::vector<long long int> visit'
   51 | vector<ll>visit(maxn);
      |           ^~~~~
a.cc:59:12: error: reference to 'visit' is ambiguous
   59 |         if(visit[itr]==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:51:11: note:                 'std::vector<long long int> visit'
   51 | vector<ll>visit(maxn);
      |           ^~~~~
a.cc: In function 'int main()':
a.cc:81:12: error: reference to 'visit' is ambiguous
   81 |         if(visit[i]==0)
      |            ^~~~~
/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:51:11: note:                 'std::vector<long long int> visit'
   51 | vector<ll>visit(maxn);
      |           ^~~~~