Language: C++

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

const int max = 8;
bool g[max][max];

int dfs(int k, int n, bool vis[])
{
	bool check = true;
  	for(int i = 0; i < n; i++)
      if(vis[i] == false)
        check = false;
  	if(check)
      return 1;
  	int res = 0;
  	for(int i = 0; i < n; i++)
    {
    	if(g[k][i] == false)
          	continue;
      	if(vis[i])
          	continue;
      	vis[i] = true;
      	res += dfs(i, n, vis);
      	vis[i] = false;
    }
  	return res;
}

int main()
{
	int n, m;
  	cin>>n>>m;
  	for(int i = 0; i < m; i++)
    {
    	int a, b;
      	cin>>a>>b;
      	g[a-1][b-1] = g[b-1][a-1] = true;
    }
  	bool vis[n];
  	memset(vis, false, sizeof(vis));
  	cout<<dfs(0, n, vis)<<"\n";
}


Compiler output:
a.cc:5:8: error: reference to 'max' is ambiguous
    5 | bool g[max][max];
      |        ^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:                 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
In file included from /usr/include/c++/14/algorithm:60:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:                 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:4:11: note:                 'const int max'
    4 | const int max = 8;
      |           ^~~
a.cc:5:13: error: reference to 'max' is ambiguous
    5 | bool g[max][max];
      |             ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:                 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:                 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:4:11: note:                 'const int max'
    4 | const int max = 8;
      |           ^~~
a.cc: In function 'int dfs(int, int, bool*)':
a.cc:18:12: error: 'g' was not declared in this scope
   18 |         if(g[k][i] == false)
      |            ^
a.cc: In function 'int main()':
a.cc:37:9: error: 'g' was not declared in this scope
   37 |         g[a-1][b-1] = g[b-1][a-1] = true;
      |         ^