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:5:12: error: reference to 'max' is ambiguous
    5 | 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:4:11: note:                 'const int max'
    4 | const int max = 8;
      |           ^~~
a.cc:5:17: error: reference to 'max' is ambiguous
    5 | 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:4:11: note:                 'const int max'
    4 | const int max = 8;
      |           ^~~
a.cc:7:36: error: reference to 'max' is ambiguous
    7 | 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:4:11: note:                 'const int max'
    4 | const int max = 8;
      |           ^~~
a.cc: In function 'int dfs(...)':
a.cc:11:29: error: 'N' was not declared in this scope
   11 |         for (int i = 0; i < N; ++i) {
      |                             ^
a.cc:12:21: error: 'visited' was not declared in this scope; did you mean 'all_visited'?
   12 |                 if (visited[i] == false)
      |                     ^~~~~~~
      |                     all_visited
a.cc:22:29: error: 'N' was not declared in this scope
   22 |         for (int i = 0; i < N; i++) {
      |                             ^
a.cc:23:21: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   23 |                 if (graph[v][i] == false) continue;
      |                     ^~~~~
      |                     isgraph
a.cc:23:27: error: 'v' was not declared in this scope
   23 |                 if (graph[v][i] == false) continue;
      |                           ^
a.cc:24:21: error: 'visited' was not declared in this scope; did you mean 'all_visited'?
   24 |                 if (visited[i]) continue;
      |                     ^~~~~~~
      |                     all_visited
a.cc:26:17: error: 'visited' was not declared in this scope; did you mean 'all_visited'?
   26 |                 visited[i] = true;
      |                 ^~~~~~~
      |                 all_visited
a.cc: In function 'int main()':
a.cc:40:17: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   40 |                 graph[A - 1][B - 1] = graph[B - 1][A - 1] = true;
      |                 ^~~~~
      |                 isgraph
a.cc:44:22: error: reference to 'max' is ambiguous
   44 |         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:4:11: note:                 'const int max'
    4 | const int max = 8;
      |           ^~~
a.cc:47:17: error: 'visited' was not declared in this scope
   47 |                 visited[i] = false;
      |                 ^~~~~~~
a.cc:50:9: error: 'visited' was not declared in this scope
   50 |         visited[0] = true;
      |         ^~~~~~~