Language: C++

#include <bits/stdc++.h>
#define ll long long
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;


int M[8][8];

int dfs_visit(int u,int color2){
    bool all_visited = true;
    for(int i =0;i<n;i++){
        if(color2[i] == WHITE) {
            all_visited = false;
            break;
        }
    }
    if(all_visited) return 1;

    int res = 0;
    color2[u] = GRAY;
    for(int v = 0; v < n; v++){
        if(M[u][v] == 0)continue;
        if(color2[v] == WHITE){
            res += dfs_visit(v);
            colo2[u] = WHITE;
        }
    }
    color[u]2 = BLACK;
    retrn res;
}

int dfs(){
    for(int i=0; i < n ; i++) color[i] = WHITE;
    int u = 0;

    int ans = dfs_visit(u, color);
    return ans;
}

int main(){
    cin>>n>>e;
    for(int i =0;i<n;i++){
        for(int j=0;j<n;j++)M[i][j] = 0;
    }
    for(int i=0;i<e;i++){
        int u,v;
        scanf("%d %d",&u,&v);
        u--;
        v--;
        M[u][v] = 1;
    }
    cout<<dfs()<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int dfs_visit(int, int)':
a.cc:13:20: error: 'n' was not declared in this scope
   13 |     for(int i =0;i<n;i++){
      |                    ^
a.cc:14:18: error: invalid types 'int[int]' for array subscript
   14 |         if(color2[i] == WHITE) {
      |                  ^
a.cc:22:11: error: invalid types 'int[int]' for array subscript
   22 |     color2[u] = GRAY;
      |           ^
a.cc:23:24: error: 'n' was not declared in this scope
   23 |     for(int v = 0; v < n; v++){
      |                        ^
a.cc:25:18: error: invalid types 'int[int]' for array subscript
   25 |         if(color2[v] == WHITE){
      |                  ^
a.cc:26:29: error: too few arguments to function 'int dfs_visit(int, int)'
   26 |             res += dfs_visit(v);
      |                    ~~~~~~~~~^~~
a.cc:11:5: note: declared here
   11 | int dfs_visit(int u,int color2){
      |     ^~~~~~~~~
a.cc:27:13: error: 'colo2' was not declared in this scope; did you mean 'color2'?
   27 |             colo2[u] = WHITE;
      |             ^~~~~
      |             color2
a.cc:30:5: error: 'color' was not declared in this scope; did you mean 'color2'?
   30 |     color[u]2 = BLACK;
      |     ^~~~~
      |     color2
a.cc:31:5: error: 'retrn' was not declared in this scope
   31 |     retrn res;
      |     ^~~~~
a.cc: In function 'int dfs()':
a.cc:35:22: error: 'n' was not declared in this scope
   35 |     for(int i=0; i < n ; i++) color[i] = WHITE;
      |                      ^
a.cc:35:31: error: 'color' was not declared in this scope
   35 |     for(int i=0; i < n ; i++) color[i] = WHITE;
      |                               ^~~~~
a.cc:38:28: error: 'color' was not declared in this scope
   38 |     int ans = dfs_visit(u, color);
      |                            ^~~~~
a.cc: In function 'int main()':
a.cc:43:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   43 |     cin>>n>>e;
      |          ^
      |          yn
a.cc:43:13: error: 'e' was not declared in this scope
   43 |     cin>>n>>e;
      |             ^
a.cc: In function 'int dfs_visit(int, int)':
a.cc:32:1: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      | ^