Language: C++

#include <iostream>
using namespace std;
const int max = 8;
bool graph[max][max];

int dfs(int v, int N, bool visited[max]) {

	bool all_visited = true;

	for (int i = 0; i < N; ++i) {
		if (visited[i] == false)
			all_visited = false;
	}

	if (all_visited) {
		return 1;
	}

	int ret = 0;

	for (int i = 0; i < N; i++) {
		if (graph[v][i] == false) continue;
		if (visited[i]) continue;

		visited[i] = true;
		ret += dfs(i, N, visited);
		visited[i] = false;
	}

	return ret;
}
int main(void) {
	int N, M;
	cin >> N >> M;

	for (int i = 0; i < M; ++i) {
		int A, B;
		cin >> A >> B;
		graph[A - 1][B - 1] = graph[B - 1][A - 1] = true;

	}

	bool visited[max];

	for (int i = 0; i < N; ++i) {
		visited[i] = false;
	}

	visited[0] = true;
	cout << dfs(0, N, visited) << endl;
	return 0;

}

Compiler output:
a.cc:4:12: error: reference to 'max' is ambiguous
    4 | bool graph[max][max];
      |            ^~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:3:11: note:                 'const int max'
    3 | const int max = 8;
      |           ^~~
a.cc:4:17: error: reference to 'max' is ambiguous
    4 | bool graph[max][max];
      |                 ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:3:11: note:                 'const int max'
    3 | const int max = 8;
      |           ^~~
a.cc:6:36: error: reference to 'max' is ambiguous
    6 | int dfs(int v, int N, bool visited[max]) {
      |                                    ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:3:11: note:                 'const int max'
    3 | const int max = 8;
      |           ^~~
a.cc: In function 'int dfs(...)':
a.cc:10:29: error: 'N' was not declared in this scope
   10 |         for (int i = 0; i < N; ++i) {
      |                             ^
a.cc:11:21: error: 'visited' was not declared in this scope; did you mean 'all_visited'?
   11 |                 if (visited[i] == false)
      |                     ^~~~~~~
      |                     all_visited
a.cc:21:29: error: 'N' was not declared in this scope
   21 |         for (int i = 0; i < N; i++) {
      |                             ^
a.cc:22:21: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   22 |                 if (graph[v][i] == false) continue;
      |                     ^~~~~
      |                     isgraph
a.cc:22:27: error: 'v' was not declared in this scope
   22 |                 if (graph[v][i] == false) continue;
      |                           ^
a.cc:23:21: error: 'visited' was not declared in this scope; did you mean 'all_visited'?
   23 |                 if (visited[i]) continue;
      |                     ^~~~~~~
      |                     all_visited
a.cc:25:17: error: 'visited' was not declared in this scope; did you mean 'all_visited'?
   25 |                 visited[i] = true;
      |                 ^~~~~~~
      |                 all_visited
a.cc: In function 'int main()':
a.cc:39:17: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   39 |                 graph[A - 1][B - 1] = graph[B - 1][A - 1] = true;
      |                 ^~~~~
      |                 isgraph
a.cc:43:22: error: reference to 'max' is ambiguous
   43 |         bool visited[max];
      |                      ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:3:11: note:                 'const int max'
    3 | const int max = 8;
      |           ^~~
a.cc:46:17: error: 'visited' was not declared in this scope
   46 |                 visited[i] = false;
      |                 ^~~~~~~
a.cc:49:9: error: 'visited' was not declared in this scope
   49 |         visited[0] = true;
      |         ^~~~~~~