Language: C

#include<stdio.h>
#define N 100

#define WHITE  0
#define GRAY  1
#define BLACK 2

int n, M[N][N];
int color[N], d[N], f[N];
int tt;

void dfs_visit(int);
void dfs();


int main(){

  int u,k,v;
  int i,j;

  scanf("%d", &n);

  for (i = 0; i<n; i++){
    for (j = 0; j<n; j++) {
      M[i][j] = 0;
    }
  }

  for (i = 0; i<n; i++ ){

    scanf("%d %d", &u, &k);
    u--;

    for (j = 0; j<k; j++ ){
      scanf("%d",&v);
      v--;
      M[u][v] = 1;

    }
  }

  dfs();

  return 0;
}



void dfs_visit(int u){
tt++;
  d[u] = tt;

  for (v = 0; v < n; v++ ){
    if ( M[u][v] == 0 ) continue;
    if ( color[v] == WHITE ){
      dfs_visit(v);
    }
  }

  color[u] = BLACK;
  f[u] = ++tt;
}

void dfs(){

  int i, u;

  for (i = 0; i < n; i++ ){
    color[i] = WHITE;
  }

  tt = 0;

  for ( u = 0; u < n; u++ ){
    if ( color[u] == WHITE ){
      dfs_visit(u);
    }
  }
  for ( i = 0; i < n; i++ ){
    printf("%d %d %d\n", i+1, d[i], f[i]);
  }
}
  int v;
  color[u] = GRAY;
tt++;
  d[u] = tt;

  for ( v = 0; v < n; v++ ){
    if ( M[u][v] == 0 ) continue;
    if ( color[v] == WHITE ){
      dfs_visit(v);
    }
  }

  color[u] = BLACK;
  f[u] = ++tt;
}

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

  tt = 0;

  for (u = 0; u<n; u++ ){
    if ( color[u] == WHITE ){
      dfs_visit(u);
    }
  }
  for (i = 0; i<n; i++ ){
    printf("%d %d %d\n", i+1, d[i], f[i]);
  }
}

Compiler output:
main.c: In function 'dfs_visit':
main.c:53:8: error: 'v' undeclared (first use in this function)
   53 |   for (v = 0; v < n; v++ ){
      |        ^
main.c:53:8: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:84:9: error: 'u' undeclared here (not in a function)
   84 |   color[u] = GRAY;
      |         ^
main.c:84:3: warning: data definition has no type or storage class
   84 |   color[u] = GRAY;
      |   ^~~~~
main.c:84:3: error: type defaults to 'int' in declaration of 'color' [-Wimplicit-int]
main.c:85:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   85 | tt++;
      |   ^~
main.c:86:3: warning: data definition has no type or storage class
   86 |   d[u] = tt;
      |   ^
main.c:86:3: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
main.c:88:3: error: expected identifier or '(' before 'for'
   88 |   for ( v = 0; v < n; v++ ){
      |   ^~~
main.c:88:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   88 |   for ( v = 0; v < n; v++ ){
      |                  ^
main.c:88:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   88 |   for ( v = 0; v < n; v++ ){
      |                        ^~
main.c:95:3: warning: data definition has no type or storage class
   95 |   color[u] = BLACK;
      |   ^~~~~
main.c:95:3: error: type defaults to 'int' in declaration of 'color' [-Wimplicit-int]
main.c:96:3: warning: data definition has no type or storage class
   96 |   f[u] = ++tt;
      |   ^
main.c:96:3: error: type defaults to 'int' in declaration of 'f' [-Wimplicit-int]
main.c:97:1: error: expected identifier or '(' before '}' token
   97 | }
      | ^
main.c:99:6: error: redefinition of 'dfs'
   99 | void dfs(){
      |      ^~~
main.c:64:6: note: previous definition of 'dfs' with type 'void()'
   64 | void dfs(){
      |      ^~~