criyle/codenet-compile-errors huggingface dataset:
Language: C++

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

#define MAX_V  8

vector<int> G[ MAX_V ] 
int visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;
int V,E;
int s,t;

int next(int u){
    for(int j = nt[u];  j < G[u].size(); j++){
        int v = G[u][j];
        if( visited[v] != 1 ){
            nt[u] = j;
            return v;
        }
    }
    return -1;
}

int dfs(){
    stack<int>st;
    st.push(1);
    visited[1] = 1;
    cnt++;

    while( !st.empty() ){
        if(cnt == V)res++;
        int u = st.top();
        int v = next(u);
        if(v != -1){
            
            st.push(v);
            visited[v] = 1;
            cnt++;
        }else{
            st.pop();
            visited[u] = 2;
            cnt--;
        }
    }
}

int main(){
    cin>>V>>E;
    for(int i =0; i < E; i++){
        cin>>s>> t;
        G[s].push_back(t);
        G[t].push_back(s);
    }
    fill(nt,nt + V,1);
    fill(visited, visited + V, 0);
    dfs();
    printf("%d¥n", res);
}


Compiler output:
a.cc:8:1: error: expected initializer before 'int'
    8 | int visited[ MAX_V ] ;
      | ^~~
a.cc: In function 'int next(int)':
a.cc:16:29: error: 'G' was not declared in this scope
   16 |     for(int j = nt[u];  j < G[u].size(); j++){
      |                             ^
a.cc:18:13: error: 'visited' was not declared in this scope
   18 |         if( visited[v] != 1 ){
      |             ^~~~~~~
a.cc: In function 'int dfs()':
a.cc:29:5: error: 'visited' was not declared in this scope
   29 |     visited[1] = 1;
      |     ^~~~~~~
a.cc:47:1: warning: no return statement in function returning non-void [-Wreturn-type]
   47 | }
      | ^
a.cc: In function 'int main()':
a.cc:53:9: error: 'G' was not declared in this scope
   53 |         G[s].push_back(t);
      |         ^
a.cc:57:10: error: 'visited' was not declared in this scope
   57 |     fill(visited, visited + V, 0);
      |          ^~~~~~~
Language: C++

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

#define MAX_V  8

vector<int> G[ MAX_V ] ;
bool visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;

int next(int u){
    for(int j = nt[u];  j < G[u].size(); j++){
        int v = G[u][j];
        if( !visited[v] ){
            nt[u] = j;
            return v;
        }
    }
    return -1;
}

int dfs(){
    stack<int>st;
    st.push(0);
    visited[0] = true;
    cnt++;

    while( !st.empty() ){
        if(cnt == V)res++;
        int u = st.top();
        int v = next(u);
        if(v != -1){
            st.push(v);
            visited[v] = true;
            cnt++;
        }else{
            st.pop();
            visited[u] = false;
            cnt--;
        }
    }
}

int main(){
    int V,E;
    cin>>V>>E;
    for(int i =0; i < E; i++){
        int s,t;
        scanf("%d %d", &s, &t);
        G[s].push_back(t);
        G[t].push_back(s);
    }
    fill(nt,nt + V,0);
    fill(visited, visited + V, false);
    dfs();
    printf("%d¥n", res);
}


Compiler output:
a.cc: In function 'int dfs()':
a.cc:31:19: error: 'V' was not declared in this scope
   31 |         if(cnt == V)res++;
      |                   ^
a.cc:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
   44 | }
      | ^
Language: C++

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

#define MAX_V  8

vector<int> G[ MAX_V ] ;
bool visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;

int next(int u){
    for(int j = nt[u];  j < G[u].size(); j++){
        int v = G[u][j];
        if( !visited[v] ){
            nt[u] = j;
            return v;
        }
    }
    return -1;
}

int dfs(){
    stack<int>st;
    st.push(0);
    visited[0] = true;
    cnt++;

    while( !st.empty() ){
        if(cnt == V)res++;
        int u = st.top();
        int v = next(u);
        if(v != -1){
            st.push(v);
            visited[v] = true;
            cnt++;
        }else{
            st.pop();
            visited[u] = false;
            cnt--;
        }
    }
}

int main(){
    int V,E;
    scanf("%d %d",  V, E);
    for(int i =0; i < E; i++){
        int s,t;
        scanf("%d %d", &s, &t);
        G[s].push_back(t);
        G[t].push_back(s);
    }
    fill(nt,nt + V,0);
    fill(visited, visited + V, false);
    dfs();
    printf("%d¥n", res);
}


Compiler output:
a.cc: In function 'int dfs()':
a.cc:31:19: error: 'V' was not declared in this scope
   31 |         if(cnt == V)res++;
      |                   ^
a.cc:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
   44 | }
      | ^
Language: C++

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

#define MAX_V  8

vector<int> G[ MAX_V ] ;
bool visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;

int next(int u){
    for(int j = nt[u];  j < G[u].size(); j++){
        int v = G[u][j];
        if( !visited[v] ){
            nt[u] = j;
            return v;
        }
    }
    return -1;
}

int dfs(){
    stack<int>st;
    st.push(0);
    visited[0] = true;
    cnt++;

    while( !st.empty() ){
        if(cnt == V)res++;
        int u = st.top();
        int v = next(u);
        if(v != -1){
            st.push(v);
            visited[v] = true;
            cnt++;
        }else{
            st.pop();
            visited[u] = false;
            cnt--;
        }
    }
}

int main(){
    int V,E;
    scanf("%d %d",  &V, &E);
    for(int i =0; i < E; i++){
        int s,t;
        scanf("%d %d", &s, &t);
        G[s].push_back(t);
        G[t].push_back(s);
    }
    fill(nt,nt + V,0);
    fill(visited, visited + V, false);
    dfs();
    printf("%d¥n", res);
}


Compiler output:
a.cc: In function 'int dfs()':
a.cc:31:19: error: 'V' was not declared in this scope
   31 |         if(cnt == V)res++;
      |                   ^
a.cc:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
   44 | }
      | ^
Language: C++

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

constant int MAX_V = 8;

vector<int> G[ MAX_V ] ;
bool visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;

int next(int u){
    for(int j = nt[u];  j < G[u].size(); j++){
        int v = G[u][j];
        if( !visited[v] ){
            nt[u] = j;
            return v;
        }
    }
    return -1;
}

int dfs(){
    stack<int>st;
    st.push(0);
    visited[0] = true;
    cnt++;
    
    while( !st.empty() ){
        if(cnt == V)res++;
        int u = st.top();
        int v = next(u);
        if(v != -1){
            st.push(v);
            visited[v] = true;
            cnt++;
        }else{
            st.pop();
            visited[u] = false;
            cnt--;
        }
    }
}

int main(){
    int V,E;
    scanf("%d %d",  &V, &E);
    for(int i =0; i < E; i++){
        int s,t;
        scanf("%d %d", &s, &t);
        G[s].push_back(t);
        G[t].push_back(s);
    }
    fill(nt,nt + V,0);
    fill(visited, visited + V, false);
    dfs();
    printf("%d¥n", res);
}


Compiler output:
a.cc:5:1: error: 'constant' does not name a type; did you mean 'const'?
    5 | constant int MAX_V = 8;
      | ^~~~~~~~
      | const
a.cc:7:16: error: 'MAX_V' was not declared in this scope
    7 | vector<int> G[ MAX_V ] ;
      |                ^~~~~
a.cc:8:15: error: 'MAX_V' was not declared in this scope
    8 | bool visited[ MAX_V ] ;
      |               ^~~~~
a.cc:9:9: error: 'MAX_V' was not declared in this scope
    9 | int nt[ MAX_V ] ;
      |         ^~~~~
a.cc: In function 'int next(int)':
a.cc:14:17: error: 'nt' was not declared in this scope; did you mean 'int'?
   14 |     for(int j = nt[u];  j < G[u].size(); j++){
      |                 ^~
      |                 int
a.cc:14:29: error: 'G' was not declared in this scope
   14 |     for(int j = nt[u];  j < G[u].size(); j++){
      |                             ^
a.cc:16:14: error: 'visited' was not declared in this scope
   16 |         if( !visited[v] ){
      |              ^~~~~~~
a.cc: In function 'int dfs()':
a.cc:27:5: error: 'visited' was not declared in this scope
   27 |     visited[0] = true;
      |     ^~~~~~~
a.cc:31:19: error: 'V' was not declared in this scope
   31 |         if(cnt == V)res++;
      |                   ^
a.cc:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
   44 | }
      | ^
a.cc: In function 'int main()':
a.cc:52:9: error: 'G' was not declared in this scope
   52 |         G[s].push_back(t);
      |         ^
a.cc:55:10: error: 'nt' was not declared in this scope; did you mean 'int'?
   55 |     fill(nt,nt + V,0);
      |          ^~
      |          int
a.cc:56:10: error: 'visited' was not declared in this scope
   56 |     fill(visited, visited + V, false);
      |          ^~~~~~~
Language: C++

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

int MAX_V = 8;

vector<int> G[ MAX_V ] ;
bool visited[ MAX_V ] ;
int nt[ MAX_V ] ;
int cnt = 0;
int res = 0;

int next(int u){
    for(int j = nt[u];  j < G[u].size(); j++){
        int v = G[u][j];
        if( !visited[v] ){
            nt[u] = j;
            return v;
        }
    }
    return -1;
}

int dfs(){
    stack<int>st;
    st.push(0);
    visited[0] = true;
    cnt++;
    
    while( !st.empty() ){
        if(cnt == V)res++;
        int u = st.top();
        int v = next(u);
        if(v != -1){
            st.push(v);
            visited[v] = true;
            cnt++;
        }else{
            st.pop();
            visited[u] = false;
            cnt--;
        }
    }
}

int main(){
    int V,E;
    scanf("%d %d",  &V, &E);
    for(int i =0; i < E; i++){
        int s,t;
        scanf("%d %d", &s, &t);
        G[s].push_back(t);
        G[t].push_back(s);
    }
    fill(nt,nt + V,0);
    fill(visited, visited + V, false);
    dfs();
    printf("%d¥n", res);
}


Compiler output:
a.cc:7:16: error: size of array 'G' is not an integral constant-expression
    7 | vector<int> G[ MAX_V ] ;
      |                ^~~~~
a.cc:8:15: error: size of array 'visited' is not an integral constant-expression
    8 | bool visited[ MAX_V ] ;
      |               ^~~~~
a.cc:9:9: error: size of array 'nt' is not an integral constant-expression
    9 | int nt[ MAX_V ] ;
      |         ^~~~~
a.cc: In function 'int dfs()':
a.cc:31:19: error: 'V' was not declared in this scope
   31 |         if(cnt == V)res++;
      |                   ^
a.cc:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
   44 | }
      | ^
Language: C++

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

int MAX_V = 8;

vector<int> G[MAX_V];
bool visited[MAX_V];
int nt[MAX_V];
int cnt = 0;
int res = 0;

int next(int u){
    for(int j = nt[u];  j < G[u].size(); j++){
        int v = G[u][j];
        if( !visited[v] ){
            nt[u] = j;
            return v;
        }
    }
    return -1;
}

int dfs(){
    stack<int>st;
    st.push(0);
    visited[0] = true;
    cnt++;
    
    while( !st.empty() ){
        if(cnt == V)res++;
        int u = st.top();
        int v = next(u);
        if(v != -1){
            st.push(v);
            visited[v] = true;
            cnt++;
        }else{
            st.pop();
            visited[u] = false;
            cnt--;
        }
    }
}

int main(){
    int V,E;
    scanf("%d %d",  &V, &E);
    for(int i =0; i < E; i++){
        int s,t;
        scanf("%d %d", &s, &t);
        G[s].push_back(t);
        G[t].push_back(s);
    }
    fill(nt,nt + V,0);
    fill(visited, visited + V, false);
    dfs();
    printf("%d¥n", res);
}


Compiler output:
a.cc:7:15: error: size of array 'G' is not an integral constant-expression
    7 | vector<int> G[MAX_V];
      |               ^~~~~
a.cc:8:14: error: size of array 'visited' is not an integral constant-expression
    8 | bool visited[MAX_V];
      |              ^~~~~
a.cc:9:8: error: size of array 'nt' is not an integral constant-expression
    9 | int nt[MAX_V];
      |        ^~~~~
a.cc: In function 'int dfs()':
a.cc:31:19: error: 'V' was not declared in this scope
   31 |         if(cnt == V)res++;
      |                   ^
a.cc:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
   44 | }
      | ^
Language: C++

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

vector<int> G[MAX_V];
bool visited[MAX_V];
int nt[MAX_V];
int cnt = 0;
int res = 0;

int next(int u){
    for(int j = nt[u];  j < G[u].size(); j++){
        int v = G[u][j];
        if( !visited[v] ){
            nt[u] = j;
            return v;
        }
    }
    return -1;
}

int dfs(){
    stack<int>st;
    st.push(0);
    visited[0] = true;
    cnt++;
    
    while( !st.empty() ){
        if(cnt == V)res++;
        int u = st.top();
        int v = next(u);
        if(v != -1){
            st.push(v);
            visited[v] = true;
            cnt++;
        }else{
            st.pop();
            visited[u] = false;
            cnt--;
        }
    }
}

int main(){
    int V,E;
    scanf("%d %d",  &V, &E);
    for(int i =0; i < E; i++){
        int s,t;
        scanf("%d %d", &s, &t);
        G[s].push_back(t);
        G[t].push_back(s);
    }
    fill(nt,nt + V,0);
    fill(visited, visited + V, false);
    dfs();
    printf("%d¥n", res);
}


Compiler output:
a.cc:5:15: error: 'MAX_V' was not declared in this scope
    5 | vector<int> G[MAX_V];
      |               ^~~~~
a.cc:6:14: error: 'MAX_V' was not declared in this scope
    6 | bool visited[MAX_V];
      |              ^~~~~
a.cc:7:8: error: 'MAX_V' was not declared in this scope
    7 | int nt[MAX_V];
      |        ^~~~~
a.cc: In function 'int next(int)':
a.cc:12:17: error: 'nt' was not declared in this scope; did you mean 'int'?
   12 |     for(int j = nt[u];  j < G[u].size(); j++){
      |                 ^~
      |                 int
a.cc:12:29: error: 'G' was not declared in this scope
   12 |     for(int j = nt[u];  j < G[u].size(); j++){
      |                             ^
a.cc:14:14: error: 'visited' was not declared in this scope
   14 |         if( !visited[v] ){
      |              ^~~~~~~
a.cc: In function 'int dfs()':
a.cc:25:5: error: 'visited' was not declared in this scope
   25 |     visited[0] = true;
      |     ^~~~~~~
a.cc:29:19: error: 'V' was not declared in this scope
   29 |         if(cnt == V)res++;
      |                   ^
a.cc:42:1: warning: no return statement in function returning non-void [-Wreturn-type]
   42 | }
      | ^
a.cc: In function 'int main()':
a.cc:50:9: error: 'G' was not declared in this scope
   50 |         G[s].push_back(t);
      |         ^
a.cc:53:10: error: 'nt' was not declared in this scope; did you mean 'int'?
   53 |     fill(nt,nt + V,0);
      |          ^~
      |          int
a.cc:54:10: error: 'visited' was not declared in this scope
   54 |     fill(visited, visited + V, false);
      |          ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,a,b,ans;
vector<int> path[10];
bool reached[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;
  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:16:8: error: 'reaced' was not declared in this scope; did you mean 'reached'?
   16 |     if(reaced[i]) continue;
      |        ^~~~~~
      |        reached
Language: C++

#include<iostream>
using namespace std;

const int nmax=8;
bool graph[nmax][nmax];

int dfs(int v,int N,bool visited[nmax]){
	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(){
	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[nmax];
	for(int i=0;i<N;i++)visited[i]=fasle;
	visited[0]=true;
	cout<<dfs(0,N,visited)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:40: error: 'fasle' was not declared in this scope
   33 |         for(int i=0;i<N;i++)visited[i]=fasle;
      |                                        ^~~~~
Language: C++

int main() {
  int n, m;
  cin >> n >> m;

  vector<vector<bool>> check(n, vector<bool>(m, false));
  for (int i = 0; i < m; i++) {
    int a, b; cin >> a >> b; a--; b--;
    check[a][b] = check[b][a] = true;
  }

  vector<int> ord(n);
  for (int i = 0; i < n; i++) {
    ord[i] = i;
  }

  int ans = 0;
  do {
    if (ord[0] != 0) break;

    bool ok = false;
    for (int i = 0; i < n - 1; i++) {
      int from = ord[i];
      int to = ord[i+1];
      if(check[from][to]) ok = true;
    }
    if(ok) ans++;
  } while (next_permutation(ord.begin(), ord.end()));
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> n >> m;
      |   ^~~
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<vector<bool>> check(n, vector<bool>(m, false));
      |   ^~~~~~
a.cc:5:17: error: expected primary-expression before 'bool'
    5 |   vector<vector<bool>> check(n, vector<bool>(m, false));
      |                 ^~~~
a.cc:8:5: error: 'check' was not declared in this scope
    8 |     check[a][b] = check[b][a] = true;
      |     ^~~~~
a.cc:11:10: error: expected primary-expression before 'int'
   11 |   vector<int> ord(n);
      |          ^~~
a.cc:13:5: error: 'ord' was not declared in this scope
   13 |     ord[i] = i;
      |     ^~~
a.cc:18:9: error: 'ord' was not declared in this scope
   18 |     if (ord[0] != 0) break;
      |         ^~~
a.cc:22:18: error: 'ord' was not declared in this scope
   22 |       int from = ord[i];
      |                  ^~~
a.cc:24:10: error: 'check' was not declared in this scope
   24 |       if(check[from][to]) ok = true;
      |          ^~~~~
a.cc:27:29: error: 'ord' was not declared in this scope
   27 |   } while (next_permutation(ord.begin(), ord.end()));
      |                             ^~~
a.cc:27:12: error: 'next_permutation' was not declared in this scope
   27 |   } while (next_permutation(ord.begin(), ord.end()));
      |            ^~~~~~~~~~~~~~~~
a.cc:28:3: error: 'cout' was not declared in this scope
   28 |   cout << ans << endl;
      |   ^~~~
a.cc:28:18: error: 'endl' was not declared in this scope
   28 |   cout << ans << endl;
      |                  ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
using Graph = vector<vector<int>>;
int ans=0;
int N,M;

// 深さ優先探索
void dfs(const Graph &G, int v,vector<int> seen) {
    seen[v] = 1; // v を訪問済にする
    if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) {
        if (seen[next_v]) continue; // next_v が探索済だったらスルー
        dfs(G, next_v, vector<bool> seen); // 再帰的に探索
    }
}

int main() {
    // 頂点数と辺数
    cin >> N >> M;

    // グラフ入力受取 (ここでは無向グラフを想定)
    Graph G(N);
    for (int i = 0; i < M; ++i) {
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    // 頂点 0 をスタートとした探索
  vector<int> seen;
    seen.assign(N, 0); // 全頂点を「未訪問」に初期化
    dfs(G, 0, seen);
}

Compiler output:
a.cc: In function 'void dfs(const Graph&, int, std::vector<int>)':
a.cc:16:37: error: expected primary-expression before 'seen'
   16 |         dfs(G, next_v, vector<bool> seen); // 再帰的に探索
      |                                     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
using Graph = vector<vector<int>>;
int ans=0;
int N,M;

// 深さ優先探索
void dfs(const Graph &G, int v,vector<int> seen) {
    seen[v] = 1; // v を訪問済にする
    if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) {
        if (seen[next_v]) continue; // next_v が探索済だったらスルー
        dfs(G, next_v, vector<bool> seen); // 再帰的に探索
    }
}

int main() {
    // 頂点数と辺数
    cin >> N >> M;

    // グラフ入力受取 (ここでは無向グラフを想定)
    Graph G(N);
    for (int i = 0; i < M; ++i) {
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    // 頂点 0 をスタートとした探索
    seen.assign(N, 0); // 全頂点を「未訪問」に初期化
    dfs(G, 0, seen);
}

Compiler output:
a.cc: In function 'void dfs(const Graph&, int, std::vector<int>)':
a.cc:16:37: error: expected primary-expression before 'seen'
   16 |         dfs(G, next_v, vector<bool> seen); // 再帰的に探索
      |                                     ^~~~
a.cc: In function 'int main()':
a.cc:34:5: error: 'seen' was not declared in this scope
   34 |     seen.assign(N, 0); // 全頂点を「未訪問」に初期化
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
using Graph = vector<vector<int>>;
int ans=0;

// 深さ優先探索
void dfs(const Graph &G, int v,vector<int> seen) {
    seen[v] = 1; // v を訪問済にする
    if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) {
        if (seen[next_v]) continue; // next_v が探索済だったらスルー
        dfs(G, next_v, vector<bool> seen); // 再帰的に探索
    }
}

int main() {
    // 頂点数と辺数
    int N, M; cin >> N >> M;

    // グラフ入力受取 (ここでは無向グラフを想定)
    Graph G(N);
    for (int i = 0; i < M; ++i) {
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    // 頂点 0 をスタートとした探索
    seen.assign(N, 0); // 全頂点を「未訪問」に初期化
    dfs(G, 0, seen);
}

Compiler output:
a.cc: In function 'void dfs(const Graph&, int, std::vector<int>)':
a.cc:11:47: error: 'N' was not declared in this scope
   11 |     if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
      |                                               ^
a.cc:15:37: error: expected primary-expression before 'seen'
   15 |         dfs(G, next_v, vector<bool> seen); // 再帰的に探索
      |                                     ^~~~
a.cc: In function 'int main()':
a.cc:33:5: error: 'seen' was not declared in this scope
   33 |     seen.assign(N, 0); // 全頂点を「未訪問」に初期化
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
using Graph = vector<vector<int>>;
int ans=0;

// 深さ優先探索
void dfs(const Graph &G, int v,vector<int> seen) {
    seen[v] = 1; // v を訪問済にする
    if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) {
        if (seen[next_v]) continue; // next_v が探索済だったらスルー
        dfs(G, next_v, vector<bool> seen); // 再帰的に探索
    }
}

int main() {
    // 頂点数と辺数
    int N, M; cin >> N >> M;

    // グラフ入力受取 (ここでは無向グラフを想定)
    Graph G(N);
    for (int i = 0; i < M; ++i) {
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    // 頂点 0 をスタートとした探索
    seen.assign(N, 0); // 全頂点を「未訪問」に初期化
    dfs(G, 0, seen);
}

Compiler output:
a.cc: In function 'void dfs(const Graph&, int, std::vector<int>)':
a.cc:10:8: error: 'accumulate' was not declared in this scope
   10 |     if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
      |        ^~~~~~~~~~
a.cc:10:47: error: 'N' was not declared in this scope
   10 |     if(accumulate(seen.begin(),seen.end(),0)==N)ans++;
      |                                               ^
a.cc:14:37: error: expected primary-expression before 'seen'
   14 |         dfs(G, next_v, vector<bool> seen); // 再帰的に探索
      |                                     ^~~~
a.cc: In function 'int main()':
a.cc:32:5: error: 'seen' was not declared in this scope
   32 |     seen.assign(N, 0); // 全頂点を「未訪問」に初期化
      |     ^~~~
Language: Java

import java.util.*;

public class Main {
	static int[][] dp;
	static Node[] v;
	static ArrayList<Integer> edges[];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next()), M = Integer.parseInt(sc.next());
		edges=new ArrayList[N];
		for(int i=0;i<N;i++) edges[i] = new ArrayList<>();
		for(int i=0;i<M;i++) {
			int a = Integer.parseInt(sc.next())-1, b = Integer.parseInt(sc.next())-1;
			edges[a].add(b);
			edges[b].add(a);
		}
		dp = new int[1<<N][N];
		for(int i =0;i<(1<<N);i++) for(int j=0;j<N;j++) dp[i][j] = -1;
		System.out.println(dp(1,0));
	}
	public static int dp(int i,int j) {
		if(i==0) return dp[i][j] = 1;
		if(dp[i][j] >= 0) return dp[i][j];
		dp[i][j]=0;
		for(int id : edges[j]) if((i & (1<<id)) != 0) dp[i][j]+= dp(i-(1<<id),id);
		return dp[i][j];
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
	static Node[] v;
	       ^
  symbol:   class Node
  location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

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

bool  abc[8][8];

int dfs(int a,int b,bool c[8]){
  
  bool abcd=true;
  for(int i=0;i<b;i++){
    if(c[i]==false)
      abcd=false;
  }
  if(abcd)
    return 1;
  
  int d=0;
  for(int i=0;i<b;i++){
    if(abc[a][i]==false)continue;
    if(c[i])continue;
    
    c[i]=true;
    
    d+=dfs(i,n,c);
    
    c[i]=false;
  }
  return d;
}
int main(){
  int e,f;
  cin >> e >> f;
  int g[f],h[f];
  for(int i=0;i<f;i++){
    cin >> g[i] >> h[i];
    abc[g[i]-1][h[i]-1] = abc[g[i]-1][h[i]-1] = true;
  }
  
  bool c[8];
  
  for(int i=0;i<e;i++){
    c[i]=false;
  }
  
  c[0]=true;
  cout << dfs(0,e,c)<<endl;
}


Compiler output:
a.cc: In function 'int dfs(int, int, bool*)':
a.cc:24:14: error: 'n' was not declared in this scope
   24 |     d+=dfs(i,n,c);
      |              ^
Language: C++

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

bool  abc[8][8];

int dfs(int a,int b,bool c[8]){
  
  bool abcd=true;
  for(int i=0;i<b;i++){
    if(c[i]==false)
      abcd=false;
  }
  if(abcd)
    return 1;
  
  int d=0;
  for(int i=0;i<b;i++){
    if(abc[a][i]==false)continue;
    if(c[i])continue;
    
    c[i]=true;
    
    d+=dfs(i,n,visited);
    
    c[i]=false;
  }
  return d;
}
int main(){
  int e,f;
  cin >> e >> f;
  int g[f],h[f];
  for(int i=0;i<f;i++){
    cin >> g[i] >> h[i];
    abc[g[i]-1][h[i]-1] = abc[g[i]-1][h[i]-1] = true;
  }
  
  bool c[8];
  
  for(int i=0;i<e;i++){
    c[i]=false;
  }
  
  c[0]=true;
  cout << dfs(0,e,visited)<<endl;
}


Compiler output:
a.cc: In function 'int dfs(int, int, bool*)':
a.cc:24:14: error: 'n' was not declared in this scope
   24 |     d+=dfs(i,n,visited);
      |              ^
a.cc:24:16: error: 'visited' was not declared in this scope
   24 |     d+=dfs(i,n,visited);
      |                ^~~~~~~
a.cc: In function 'int main()':
a.cc:46:19: error: 'visited' was not declared in this scope
   46 |   cout << dfs(0,e,visited)<<endl;
      |                   ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int m[9][9];
int vis[9];
int sum,n;
void dfs(int cot,int num){
    if(num==n){
        sum++;
        return;
    }
    for(int i=2;i<10;i++){
        if(m[cot][i]==1&&vis[i]==0){
            vis[i]=1;
            dfs(i,num+1);
            vis[i]=0;
        }
    }
}
int main(){
    int m,a,b;
    cin>>n>>m;
    for(int i = 0;i<m;i++){
        cin>>a>>b;
        m[a][b]=1;
        m[b][a]=1;
    }
    sum = 0;
    vis[1]=1;
    dfs(1,1);
    cout<<sum;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:10: error: invalid types 'int[int]' for array subscript
   24 |         m[a][b]=1;
      |          ^
a.cc:25:10: error: invalid types 'int[int]' for array subscript
   25 |         m[b][a]=1;
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int m[9][9];
int vis[9][9];
int sum,n;
void dfs(int cot,int num){
    if(num==n){
        sum++;
        return;
    }
    for(int i=2;i<10;i++){
        if(m[cot][i]==1&&vis[cot][i]==0){
            vis[i]=1;
            dfs(i,num+1);
            vis[i]=0;
        }
    }
}
int main(){
    int m,a,b;
    cin>>n>>m;
    for(int i = 0;i<m;i++){
        cin>>a>>b;
        m[a][b]=1;
        m[b][a]=1;
    }
    sum = 0;
    vis[1]=1;
    dfs(1,1);
    cout<<sum;
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:13:19: error: incompatible types in assignment of 'int' to 'int [9]'
   13 |             vis[i]=1;
      |             ~~~~~~^~
a.cc:15:19: error: incompatible types in assignment of 'int' to 'int [9]'
   15 |             vis[i]=0;
      |             ~~~~~~^~
a.cc: In function 'int main()':
a.cc:24:10: error: invalid types 'int[int]' for array subscript
   24 |         m[a][b]=1;
      |          ^
a.cc:25:10: error: invalid types 'int[int]' for array subscript
   25 |         m[b][a]=1;
      |          ^
a.cc:28:11: error: incompatible types in assignment of 'int' to 'int [9]'
   28 |     vis[1]=1;
      |     ~~~~~~^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int m[9][9];
int vis[9][9];
int sum,n;
void dfs(int cot,int num){
    if(num==n){
        sum++;
        return
    }
    for(int i=2;i<10;i++){
        if(m[cot][i]==1&&vis[cot][i]==0){
            vis[i]=1;
            dfs(i,num+1);
            vis[i]=0;
        }
    }
}
int main(){
    int m,a,b;
    cin>>n>>m;
    for(int i = 0;i<m;i++){
        cin>>a>>b;
        m[a][b]=1;
        m[b][a]=1;
    }
    sum = 0;
    vis[1]=1;
    dfs(1,1);
    cout<<sum;
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:10:5: error: expected primary-expression before '}' token
   10 |     }
      |     ^
a.cc:9:15: error: expected ';' before '}' token
    9 |         return
      |               ^
      |               ;
   10 |     }
      |     ~          
a.cc:13:19: error: incompatible types in assignment of 'int' to 'int [9]'
   13 |             vis[i]=1;
      |             ~~~~~~^~
a.cc:15:19: error: incompatible types in assignment of 'int' to 'int [9]'
   15 |             vis[i]=0;
      |             ~~~~~~^~
a.cc: In function 'int main()':
a.cc:24:10: error: invalid types 'int[int]' for array subscript
   24 |         m[a][b]=1;
      |          ^
a.cc:25:10: error: invalid types 'int[int]' for array subscript
   25 |         m[b][a]=1;
      |          ^
a.cc:28:11: error: incompatible types in assignment of 'int' to 'int [9]'
   28 |     vis[1]=1;
      |     ~~~~~~^~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int max_int = 100;
vector<vector<bool>> G(max_int, vector<bool>(max_int, false));

int visit(int v, int N, vector<bool> visited){
  bool all_visited = true;
  for(int i = 0; i < visited.size(); i++){
    if(visited[i] == false) all_visited = false;
  }
  
  int ret = 0;
  if(all_visited) return 1;
  else{
    for(int j = 0; j < N ;j++){
      if(G[v][j] == true){
        visited[j] = true;
        ret += visit(j, N, visited); 
      }
    }
  }
  return ret;
}
 
int main(){
  int N, M;
  cin >> N >> M;
    
  for(int i = 0; i < M; i++){
    int a, b;
    cin >> a >> b;
    a--,b--;
    G[a][b] = G[b][a] = true;
  }//グラフ読み込み
  
  vector<bool> visited(N,false);
  //頂点1からスタート
  int ans = visit(0, N, &visited);
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:25: error: could not convert '& visited' from 'std::vector<bool>*' to 'std::vector<bool>'
   41 |   int ans = visit(0, N, &visited);
      |                         ^~~~~~~~
      |                         |
      |                         std::vector<bool>*
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int max_int = 8;
vector<vector<bool>> G(max_int, vector<bool>(max_int, false));

int visit(int v, int N, vector<bool> visited){
  bool all_visited = true;
  for(int i = 0; i < visited.size(); i++){
    if(visited[i] == false) all_visited false;
  }
  
  int ret = 0;
  if(all_visited) return 1;
  else{
    for(int j = 0; j < N ;j++){
      if(G[v][j] == true){
        visited[j] = true;
        ret += visit(j, N, visited); 
      }
    }
  }
  return ret;
}
 
int main(){
  int N, M;
  cin >> N >> M;
    
  for(int i = 0; i < M; i++){
    int a, b;
    cin >> a >> b;
    a--,b--;
    G[a][b] = G[b][a] = true;
  }//グラフ読み込み
  
  vector<bool> visited(N,false);
  //頂点1からスタート
  int ans = visit(0, N, visited);
  
}


Compiler output:
a.cc: In function 'int visit(int, int, std::vector<bool>)':
a.cc:12:40: error: expected ';' before 'false'
   12 |     if(visited[i] == false) all_visited false;
      |                                        ^~~~~~
      |                                        ;
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int max_int = 8;
vector<vector<bool>> G(max_int, vector<bool>(max_int, false));

int visit(int v, int N, vector<bool> visited){
  bool all_visited = true;
  for(int i = 0; i < visited.size(); i++){
    if(visited[i] == false) all_visited false;
  }
  
  if(all_visited) return 1;
  int ret = 0;
  else{
    for(int j = 0; j < N ;j++){
      if(G[v][j] == true){
        visited[j] = true;
        ret += visit(j, N, visited); 
      }
    }
  }
  return ret;
}
 
int main(){
  int N, M;
  cin >> N >> M;
    
  for(int i = 0; i < M; i++){
    int a, b;
    cin >> a >> b;
    a--,b--;
    G[a][b] = G[b][a] = true;
  }//グラフ読み込み
  
  vector<bool> visited(N,false);
  //頂点1からスタート
  int ans = visit(0, N, visited);
  
}


Compiler output:
a.cc: In function 'int visit(int, int, std::vector<bool>)':
a.cc:12:40: error: expected ';' before 'false'
   12 |     if(visited[i] == false) all_visited false;
      |                                        ^~~~~~
      |                                        ;
a.cc:17:3: error: 'else' without a previous 'if'
   17 |   else{
      |   ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const max_int = 8;
vector<vector<bool>> G(max_int, vector<bool>(max_int, false));

int visit(int v, int N, vector<bool> visited){
  bool all_visited = true;
  for(int i = 0; i < visited.size(); i++){
    if(visited[i] == false) all_visited false;
  }
  
  if(all_visited) return 1;
  int ret = 0;
  else{
    for(int j = 0; j < N ;j++){
      if(G[v][j] == true){
        visited[j] = true;
        ret += visit(j, N, visited); 
      }
    }
  }
  return ret;
}
 
int main(){
  int N, M;
  cin >> N >> M;
    
  for(int i = 0; i < M; i++){
    int a, b;
    cin >> a >> b;
    a--,b--;
    G[a][b] = G[b][a] = true;
  }//グラフ読み込み
  
  vector<bool> visited(N,false);
  //頂点1からスタート
  int ans = visit(0, N, visited);
  
}

Compiler output:
a.cc:6:7: error: 'max_int' does not name a type; did you mean 'u_int'?
    6 | const max_int = 8;
      |       ^~~~~~~
      |       u_int
a.cc:7:24: error: 'max_int' was not declared in this scope; did you mean 'u_int'?
    7 | vector<vector<bool>> G(max_int, vector<bool>(max_int, false));
      |                        ^~~~~~~
      |                        u_int
a.cc:7:46: error: 'max_int' was not declared in this scope; did you mean 'u_int'?
    7 | vector<vector<bool>> G(max_int, vector<bool>(max_int, false));
      |                                              ^~~~~~~
      |                                              u_int
a.cc: In function 'int visit(int, int, std::vector<bool>)':
a.cc:12:40: error: expected ';' before 'false'
   12 |     if(visited[i] == false) all_visited false;
      |                                        ^~~~~~
      |                                        ;
a.cc:17:3: error: 'else' without a previous 'if'
   17 |   else{
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
//桁
int kt(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
int a,b;
vector<int> graph[10];
  int answer=0;
  bool visited[10];
void dfs(int c,int d){
  visited[c]=true;
  d++;
  if(d==a){
    answer++;
  }
  for(int e:graph[a]){
    if(!visited)
      dfs(e,d);
  }
  visited[c]==false;
}
signed main(){
  cin>>a>>b;
  rep(i,M){
    int A,B;
    cin>>A>>B;
    graph[B-1].push_back(A-1);
    graph[A-1].push_back(B-1);
  }
  dfs(0,0);
  cout<<answer<<endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:69:9: error: 'M' was not declared in this scope
   69 |   rep(i,M){
      |         ^
a.cc:3:32: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                                ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
//桁
int kt(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
int a,b;
vector<int> graph[10];
  int answer=0;
  bool visited[10];
void dfs(int c,int d){
  visited[c]=true;
  d++;
  if(d==a){
    answer++;
  }
  for(int e:graph[a]){
    if(!visited)
      dfs(e,d);
  }
  visited[c]==false;
}
signed main(){
  cin>>a>>b;
  rep(0,M){
    int A,B;
    cin>>A>>B;
    graph[B-1].push_back(A-1);
    graph[A-1].push_back(B-1);
  }
  dfs(0,0);
  cout<<answer<<endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:69:7: error: expected unqualified-id before numeric constant
   69 |   rep(0,M){
      |       ^
a.cc:3:26: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                          ^
a.cc:69:7: error: expected ';' before numeric constant
   69 |   rep(0,M){
      |       ^
a.cc:3:26: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                          ^
a.cc:69:7: error: lvalue required as left operand of assignment
   69 |   rep(0,M){
      |       ^
a.cc:3:26: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                          ^
a.cc:69:9: error: 'M' was not declared in this scope
   69 |   rep(0,M){
      |         ^
a.cc:3:32: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                                ^
a.cc:3:33: error: expected ')' before ';' token
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                     ~           ^
a.cc:69:3: note: in expansion of macro 'rep'
   69 |   rep(0,M){
      |   ^~~
a.cc:69:7: error: lvalue required as increment operand
   69 |   rep(0,M){
      |       ^
a.cc:3:36: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                                    ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
//桁
int kt(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
int a,b;
vector<int> graph[10];
  int answer=0;
  bool visited[10];
void dfs(int c,int d){
  visited[c]==true;
  d++;
  if(d==a){
    answer++;
  }
  for(int e:graph[a]){
    if(!visited)
      dfs(e,d)
  }
  visited[c]==false;
}
signed main(){
  cin>>a>>b;
  rep(0,M){
    int A,B;
    cin>>A>>B;
    graph[B-1].push_back(A-1);
    graph[A-1].push_back(B-1);
  }
  dfs(0,0);
  cout<<answer<<endl;
}
  

Compiler output:
a.cc: In function 'void dfs(long long int, long long int)':
a.cc:63:15: error: expected ';' before '}' token
   63 |       dfs(e,d)
      |               ^
      |               ;
   64 |   }
      |   ~            
a.cc: In function 'int main()':
a.cc:69:7: error: expected unqualified-id before numeric constant
   69 |   rep(0,M){
      |       ^
a.cc:3:26: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                          ^
a.cc:69:7: error: expected ';' before numeric constant
   69 |   rep(0,M){
      |       ^
a.cc:3:26: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                          ^
a.cc:69:7: error: lvalue required as left operand of assignment
   69 |   rep(0,M){
      |       ^
a.cc:3:26: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                          ^
a.cc:69:9: error: 'M' was not declared in this scope
   69 |   rep(0,M){
      |         ^
a.cc:3:32: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                                ^
a.cc:3:33: error: expected ')' before ';' token
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                     ~           ^
a.cc:69:3: note: in expansion of macro 'rep'
   69 |   rep(0,M){
      |   ^~~
a.cc:69:7: error: lvalue required as increment operand
   69 |   rep(0,M){
      |       ^
a.cc:3:36: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;++i)
      |                                    ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
using graph = vector<vector<int>>;
graph v(1000);
int c = 0;
int n,m;
vector<bool> seen;
void dfs(const graph &v, int q, int depth){
        seen[q] = true;
        int ok = 0;
        for(int i = 0; i < n; i++){
                if(seen[i + 1]) ok++;
                }
        if(ok == n) c++;
        for (auto next_q : v[q]){
                if(seen[next_q]) continue;
                dfs(v, next_q, depth + 1);
                if(q == 1){
                        seen.assign(n, false);
                        seen[1] = true;
                        seen[v] = true;
                        }       
                }
                
                seen[q] = false;
}
int main(){
cin >> n >> m;
for(int i = 0; i < m; i++){
        int a,b; cin >> a >> b;
        v[a].push_back(b);
        v[b].push_back(a);
        }
seen.assign(n, false);
dfs(v, 1, 1);
cout << c << "\n";
return 0;
}

Compiler output:
a.cc: In function 'void dfs(const graph&, int, int)':
a.cc:22:29: error: no match for 'operator[]' (operand types are 'std::vector<bool>' and 'const graph' {aka 'const std::vector<std::vector<int> >'})
   22 |                         seen[v] = true;
      |                             ^
In file included from /usr/include/c++/14/vector:67,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_bvector.h:1086:7: note: candidate: 'std::vector<bool, _Alloc>::reference std::vector<bool, _Alloc>::operator[](size_type) [with _Alloc = std::allocator<bool>; reference = std::vector<bool>::reference; size_type = long unsigned int]'
 1086 |       operator[](size_type __n)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:1086:28: note:   no known conversion for argument 1 from 'const graph' {aka 'const std::vector<std::vector<int> >'} to 'std::vector<bool>::size_type' {aka 'long unsigned int'}
 1086 |       operator[](size_type __n)
      |                  ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:1091:7: note: candidate: 'std::vector<bool, _Alloc>::const_reference std::vector<bool, _Alloc>::operator[](size_type) const [with _Alloc = std::allocator<bool>; const_reference = bool; size_type = long unsigned int]'
 1091 |       operator[](size_type __n) const
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:1091:28: note:   no known conversion for argument 1 from 'const graph' {aka 'const std::vector<std::vector<int> >'} to 'std::vector<bool>::size_type' {aka 'long unsigned int'}
 1091 |       operator[](size_type __n) const
      |                  ~~~~~~~~~~^~~
Language: C++

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int g[8][8];
int n;

int dfs(int v, vector<int> visited)
{
    if (accumulate(ALL(visited), 0) == n)
        return 1;

    int sum = 0;

    rep(i, n)
    {
        if (!g[v][i] || visited[i])
            continue;

        visited[i] = 1;
        sum += dfs(i, visited);
        visited[i] = 0;
    }

    return sum;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
vector<vector<int>>E(100);
int ans=0;
int n,m;
void dfs(int now,int vis){
  if(vis==(1<<n)-1){ans++;return;}
  for(auto a:E[now]){
    if(vis&(1<<a) == 0){
      dfs(a,vis|(1<<a));
    }
  }
  return;
}
int main(){
  cin>>n>>m;
  for(int i=0;i<m;i++){
    int a,b;cin>>a>>b;
    E[--a].pb(--b);
    E[b].pb(a);
  }
  dfs(0,1);
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'pb'
   19 |     E[--a].pb(--b);
      |            ^~
a.cc:20:10: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'pb'
   20 |     E[b].pb(a);
      |          ^~
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int bfs(int now,int n,vector<int> *v,bool visited[n]){
    visited[now] = true;
    int path = 0;
    //cout << "Now=" << now <<endl;
    for(int i=0;i<n;i++){
        if(!visited[i]){
            break;
        }
        if(i==n-1){
            return 1;
        }
    }

    for(int i=0;i<v[now].size();i++){
        if(visited[v[now][i]] == true){
            continue;
        }
        path += bfs(v[now][i],n,v,visited);
        visited[v[now][i]] = false;
    }
    return path;
}

int main(){
    int n,m;
    cin >> n >> m;
    vector <int>  v[n];
    for(int i=0;i<m;i++){
        int a,b;
        cin >> a >> b;
        a--;b--;
        v[a].push_back(b);
        v[b].push_back(a);
    } 
    bool visited[n];
    for(int i=0;i<n;i++){
        visited[i] = false;
    }
    /*
    for(int i=0;i<n;i++){
        for(int j=0;j<v[i].size();j++){
            cout << v[i][j] << " " ;
        }
        cout << endl;
    }*/
    int ans = bfs(0,n,v,visited);
    cout << ans <<endl;return 0;
}

Compiler output:
a.cc:6:52: error: use of parameter outside function body before ']' token
    6 | int bfs(int now,int n,vector<int> *v,bool visited[n]){
      |                                                    ^
a.cc: In function 'int bfs(...)':
a.cc:7:5: error: 'visited' was not declared in this scope
    7 |     visited[now] = true;
      |     ^~~~~~~
a.cc:7:13: error: 'now' was not declared in this scope
    7 |     visited[now] = true;
      |             ^~~
a.cc:10:19: error: 'n' was not declared in this scope
   10 |     for(int i=0;i<n;i++){
      |                   ^
a.cc:19:19: error: 'v' was not declared in this scope
   19 |     for(int i=0;i<v[now].size();i++){
      |                   ^
a.cc:23:31: error: 'n' was not declared in this scope
   23 |         path += bfs(v[now][i],n,v,visited);
      |                               ^