Language: C++

#include<bits/stdc++.h>
#define SPEED ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define ll long long int
#define inf 999999999
#define maxn 200003
const ll mod = 1e9+7;
using namespace std;

int n, t;
vector<int> adj[maxn];
bool visit[maxn];
void add_edge(int a, int b)
{
	adj[a].push_back(b);
	adj[b].push_back(a);
}
void dfs(int src)
{
	visit[src] = true;t++;
	for(auto c: adj[src])
	{
		if(!visit[c])
		{
			dfs(c);
		}
	}
}
void code()
{
	int m;
	cin >> n >> m;
	for(int i=0;i<=n;i++){
		adj[i].clear();
		visit[i]=false;
	}
	for(int i = 0; i < m; i++)
	{
		int a, b;
		cin >> a >> b;
		add_edge(a,b);
	}
	//memset(visit,false,sizeof(visit));
	int maxm = INT_MIN;
	for(int i = 0; i <= n; i++)
	{
		if(!visit[i]){
			t = 0;
			dfs(i);
			maxm= max(t,maxm);
		}
	}
	cout << maxm << "\n";
}
int main()
{
	SPEED
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.out","w",stdout);
	#endif
	int t = 1;
	while(t--)
	{
		code();
	}
}


Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:19:9: error: reference to 'visit' is ambiguous
   19 |         visit[src] = true;t++;
      |         ^~~~~
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:11:6: note:                 'bool visit [200003]'
   11 | bool visit[maxn];
      |      ^~~~~
a.cc:22:21: error: reference to 'visit' is ambiguous
   22 |                 if(!visit[c])
      |                     ^~~~~
/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:11:6: note:                 'bool visit [200003]'
   11 | bool visit[maxn];
      |      ^~~~~
a.cc: In function 'void code()':
a.cc:34:17: error: reference to 'visit' is ambiguous
   34 |                 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:11:6: note:                 'bool visit [200003]'
   11 | bool visit[maxn];
      |      ^~~~~
a.cc:46:21: error: reference to 'visit' is ambiguous
   46 |                 if(!visit[i]){
      |                     ^~~~~
/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:11:6: note:                 'bool visit [200003]'
   11 | bool visit[maxn];
      |      ^~~~~