Language: C

int n, time = 0;
int color[N], d[N], f[N], array[N][N];

void DFS(){
  int i;
  for(i = 1; i < n+1; i++){
      color[i] = WHITE;
  }

  for(i = 1; i < n+1; i++){
    if(color[i] == WHITE) DFSvisit(i);
  }
}

void DFSvisit(int u){
  int i;
  color[u] = GRAY;
  d[u] = ++time;
  
  for(i = 1; i < n+1; i++){
    if((color[i] == WHITE) && (array[u][i] == 1)) DFSvisit(i);
  }
  color[u] = BLACK;
  f[u] = ++time;
}

main(){

  scanf("%d", &n);

  int i, u, v, j, e;
  for(i = 1; i < n+1; i++){
    for(j = 1; j < n+1; j++){
      array[i][j] = 0;
    }
  }

  for(i = 1; i < n+1; i++){
    scanf("%d%d", &u, &e);
    for(j = 1; j < e+1; j++){
      scanf("%d", &v);
      array[i][v] = 1;
    }
  }

  DFS();
  
  for(i = 1; i < n+1; i++){
    printf("%d ", i);
    printf("%d ", d[i]);
    printf("%d\n", f[i]);
  }
  return 0;
}

Compiler output:
main.c:2:11: error: 'N' undeclared here (not in a function)
    2 | int color[N], d[N], f[N], array[N][N];
      |           ^
main.c: In function 'DFS':
main.c:7:18: error: 'WHITE' undeclared (first use in this function)
    7 |       color[i] = WHITE;
      |                  ^~~~~
main.c:7:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:27: error: implicit declaration of function 'DFSvisit' [-Wimplicit-function-declaration]
   11 |     if(color[i] == WHITE) DFSvisit(i);
      |                           ^~~~~~~~
main.c: At top level:
main.c:15:6: warning: conflicting types for 'DFSvisit'; have 'void(int)'
   15 | void DFSvisit(int u){
      |      ^~~~~~~~
main.c:11:27: note: previous implicit declaration of 'DFSvisit' with type 'void(int)'
   11 |     if(color[i] == WHITE) DFSvisit(i);
      |                           ^~~~~~~~
main.c: In function 'DFSvisit':
main.c:17:14: error: 'GRAY' undeclared (first use in this function)
   17 |   color[u] = GRAY;
      |              ^~~~
main.c:21:21: error: 'WHITE' undeclared (first use in this function)
   21 |     if((color[i] == WHITE) && (array[u][i] == 1)) DFSvisit(i);
      |                     ^~~~~
main.c:23:14: error: 'BLACK' undeclared (first use in this function)
   23 |   color[u] = BLACK;
      |              ^~~~~
main.c: At top level:
main.c:27:1: error: return type defaults to 'int' [-Wimplicit-int]
   27 | main(){
      | ^~~~
main.c: In function 'main':
main.c:29:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   29 |   scanf("%d", &n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int n, time = 0;
main.c:29:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   29 |   scanf("%d", &n);
      |   ^~~~~
main.c:29:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:49:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   49 |     printf("%d ", i);
      |     ^~~~~~
main.c:49:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:49:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:49:5: note: include '<stdio.h>' or provide a declaration of 'printf'