Language: C++

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

#define                                 pai                                         acos(-1)
#define                                 ll                                          long long
#define                                 pb                                          push_back
#define                                 mp                                          make_pair
#define                                 pll                                         pair<ll,ll>
#define                                 sz(a)                                       (ll)a.size()
#define                                 endl                                        "\n"
#define                                 gcd(a, b)                                   __gcd(a, b)
#define                                 lcm(a, b)                                   (((a)*(b))/gcd(a,b))
#define                                 all(vec)                                    vec.begin(),vec.end()
#define                                 ms(a, b)                                    memset(a,b,sizeof(a))
#define                                 TEST_CASE(t)                                for(int www=1;www<=t;www++)
#define                                 PRINT_CASE                                  printf("Case %d: ",z)
#define                                 fii                                         freopen("input.txt","r",stdin);
#define                                 foo                                         freopen("output.txt","w",stdout);
#define                                 fast                                        ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);



vector<ll>adj[200007];
bool visit[200007];

ll cnt=0;
void dfs(ll s)
{
    cnt++;
    visit[s]=true;
    //cout<<s<<"==="<<visit[s]<<endl;
    for(ll i=0;i<adj[s].size();i++)
    {
        ll u=adj[s][i];
        if(visit[u]==false)
        {
            dfs(u);
        }
    }
}
int  main()
{
    ll i,j,k,a,b,c,d=0,n,m,t,h,u,v,x,y,z;
    cin>>n>>m;
    for(i=1;i<=m;i++)
    {
        cin>>u>>v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    ll mx=0;
    ms(visit,false);

    for(i=1;i<=n;i++)
    {
        cnt=0;
        if(visit[i]==false)
        {
           dfs(i);
        }
        mx=max(mx,cnt);
    }
    cout<<mx<<endl;
    return 0;
}




Compiler output:
a.cc: In function 'void dfs(long long int)':
a.cc:30:5: error: reference to 'visit' is ambiguous
   30 |     visit[s]=true;
      |     ^~~~~
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:24:6: note:                 'bool visit [200007]'
   24 | bool visit[200007];
      |      ^~~~~
a.cc:35:12: error: reference to 'visit' is ambiguous
   35 |         if(visit[u]==false)
      |            ^~~~~
/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:24:6: note:                 'bool visit [200007]'
   24 | bool visit[200007];
      |      ^~~~~
a.cc: In function 'int main()':
a.cc:52:8: error: reference to 'visit' is ambiguous
   52 |     ms(visit,false);
      |        ^~~~~
a.cc:14:92: note: in definition of macro 'ms'
   14 | #define                                 ms(a, b)                                    memset(a,b,sizeof(a))
      |                                                                                            ^
/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:24:6: note:                 'bool visit [200007]'
   24 | bool visit[200007];
      |      ^~~~~
a.cc:52:8: error: reference to 'visit' is ambiguous
   52 |     ms(visit,false);
      |        ^~~~~
a.cc:14:103: note: in definition of macro 'ms'
   14 | #define                                 ms(a, b)                                    memset(a,b,sizeof(a))
      |                                                                                                       ^
/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:24:6: note:                 'bool visit [200007]'
   24 | bool visit[200007];
      |      ^~~~~
a.cc:57:12: error: reference to 'visit' is ambiguous
   57 |         if(visit[i]==false)
      |            ^~~~~
/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:24:6: note:                 'bool visit [200007]'
   24 | bool visit[200007];
      |      ^~~~~