Language: C++

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


int MOD=1000000007;

int N,M;
int a[50],b[50];

bool graph[50][50];
bool visit[50];

void dfs(int v){
    visit[v]=true;
    for(int v2=0; v2<N; ++v2){
        if(graph[v][v2]==false) continue;
        if(visit[v2]==true) continue;
        dfs(v2);
    }
}

int main(void){
    cin >> N >> M;
    for(int i=0; i<M; i++){
        cin >> a[i] >> b[i];
        a[i]--,b[i]--;
        graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;
        }
        int ans=0;

        for(int i=0; i<M; ++i){
            graph[a[i]][b[i]]=graph[b[i]][a[i]]=false;
            for(int j=0; j<N; j++) visit[j]=false;
            dfs(0);
            bool cheak=false;
            for(int j=0; j<N; j++) if(visit[j]==false) cheak=true;
            if(cheak) ans+=1;

            graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;

        }


Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:18:5: error: reference to 'visit' is ambiguous
   18 |     visit[v]=true;
      |     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:4:
/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:15:6: note:                 'bool visit [50]'
   15 | bool visit[50];
      |      ^~~~~
a.cc:21:12: error: reference to 'visit' is ambiguous
   21 |         if(visit[v2]==true) continue;
      |            ^~~~~
/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:15:6: note:                 'bool visit [50]'
   15 | bool visit[50];
      |      ^~~~~
a.cc: In function 'int main()':
a.cc:37:36: error: reference to 'visit' is ambiguous
   37 |             for(int j=0; j<N; j++) visit[j]=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:15:6: note:                 'bool visit [50]'
   15 | bool visit[50];
      |      ^~~~~
a.cc:40:39: error: reference to 'visit' is ambiguous
   40 |             for(int j=0; j<N; j++) if(visit[j]==false) cheak=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:15:6: note:                 'bool visit [50]'
   15 | bool visit[50];
      |      ^~~~~
a.cc:45:10: error: expected '}' at end of input
   45 |         }
      |          ^
a.cc:26:15: note: to match this '{'
   26 | int main(void){
      |               ^