Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,a,b,ans;
bool reaced[10];
void dfs(int x){
  reached[x] = true;
  int c = 0;
  for(int i=0;i<n;++i)
    if(reached[i]) c++;
  if(c==n){
    ans++;
    return;
  }
  for(auto &i:path[x]){
    if(reaced[i]) continue;
    dfs(i);
    reached[i] = false;
  }
}

int main()
{
  cin >> n >> m;
  vector<vector<int>> path[n];
  for(int i=0; i<m; i++){
    cin >> a >> b;
    a--;
    b--;
    path[a].push_back(b);
    path[b].push_back(a);
  }
  
  ans = 0;
  for(int i=0;i<n;++i) reached[i]=false;
  dfs(0);
  cout << ans << "\n";
  
}


Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:6:3: error: 'reached' was not declared in this scope; did you mean 'reaced'?
    6 |   reached[x] = true;
      |   ^~~~~~~
      |   reaced
a.cc:14:15: error: 'path' was not declared in this scope; did you mean 'std::filesystem::__cxx11::path'?
   14 |   for(auto &i:path[x]){
      |               ^~~~
      |               std::filesystem::__cxx11::path
In file included from /usr/include/c++/14/filesystem:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_path.h:293:9: note: 'std::filesystem::__cxx11::path' declared here
  293 |   class path
      |         ^~~~
a.cc: In function 'int main()':
a.cc:29:22: error: no matching function for call to 'std::vector<std::vector<int> >::push_back(int&)'
   29 |     path[a].push_back(b);
      |     ~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::vector<int> >::value_type&' {aka 'const std::vector<int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::vector<int> >::value_type&&' {aka 'std::vector<int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:30:22: error: no matching function for call to 'std::vector<std::vector<int> >::push_back(int&)'
   30 |     path[b].push_back(a);
      |     ~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::vector<int> >::value_type&' {aka 'const std::vector<int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::vector<int> >::value_type&&' {aka 'std::vector<int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:34:24: error: 'reached' was not declared in this scope; did you mean 'reaced'?
   34 |   for(int i=0;i<n;++i) reached[i]=false;
      |                        ^~~~~~~
      |                        reaced