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

#include<stdio.h>
#define N 101

typedef struct{
  int u;
  int k;
  int v[N];
  int color;
  int d;
  int f;
}Graph;

void dfs(void);
void visit(int);
void push(int);
int isFull(void);
int isEmpty(void);
int pop(void);

Graph G[N];
int n, time, S[N];
int top=0;

int main()
{

  int u, k, i, j;

  scanf("%d", &n);

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

  dfs();

  for(i = 1; i <= n; i++){
    printf("%d %d %d\n", G[i].u, G[i].d, G[i].f);
  }

  return 0;
}


//スタック
void dfs(void)
{
  int i;

  for(i = 1; i <= n; i++) G[i].color = 1; //1 = white
  time = 0;
  if(G[1].color == 1) visit(1);
}

void visit(int r)
{
   int u, v=r;

  push(r); // Stack S
  G[r].color = 2; //2 = GRAY
  G[r].d = 1 + time;
  time++;

  while(isEmpty() == 1){
    u = S[top];
      v = G[G[u].v[2]].u; // the next vertex of u
    else v = G[G[u].v[1]].u;

    if(v >= 0){
      if(G[v].color == 1){
	push(v);
	if(G[v].v[2] > 0) G[v].color = 4;
	else G[v].color = 2;
	G[v].d = 1 + time;
	time++;
      }
      else{
	u = pop();
	G[u].color = 3; //3 = BLACK
	G[u].f = 1 + time;
	time++;
      }
    }
  }
}

void push(int x)
{
  if(isFull() == 1){
    top++;
    S[top] = x;
  }
}

int isFull(void)
{
  if(top > N - 1) return 0;
  else return 1;
}

int isEmpty(void)
{
  if(top == 0) return 0;
  if(top != 0) return 1;
}

int pop(void)
{
  if(isEmpty() == 1){
  top--;
  return S[top+1];
  }
}

Compiler output:
main.c: In function 'visit':
main.c:70:5: error: 'else' without a previous 'if'
   70 |     else v = G[G[u].v[1]].u;
      |     ^~~~
Language: C

#include<stdio.h>

void visit(int);
int G[101][101];
int d[101],f[101],color[101],time,n;

void visit(int v){
  int i;
  color[v]=1;
  d[v]=++time;
  for(i=0;i<n;i++){
    if(G[v][i]==1){
      if(color[i]==0) visit(i);
    }
  }
  color[v]=2;
  f[v]=++time;
}

int main(){

  int i,j,v1,v2,m;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    color[i]=0;
    for(j=0;j<n;j++){
      G[i][j]=0;
    }
  }

  time=0;

  for(i=0;i<n;i++){
    scanf("%d%d",&v1,&m);
    for(j=0;j<m;j++){
      scanf("%d",&v2);
      G[v-1][v2-1]=1;
    }
  }

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

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

Compiler output:
main.c: In function 'main':
main.c:38:9: error: 'v' undeclared (first use in this function)
   38 |       G[v-1][v2-1]=1;
      |         ^
main.c:38:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

int temp[101],d[101],f[101];
int time,N;
int A[101][101];

void DFS();

void DFSvisit(int u){
  int v;

  temp[u]=g;
  time++;
  d[u]=time;

  for(v=1;v<=N;v++){
    if(A[u][v]==0){
      continue;
    }
    if(temp[v]==w){
      DFSvisit(v);
    }
  }  
  
  temp[u] = b;
  f[u] = ++time;
}

void DFS(){
  int i;
  for(i=1;i<=N;i++){
    temp[i] = w;
  }

  time=0;

  for(i=1;i<=N;i++){
    if(temp[i]==w){
      DFSvisit(i);
    }
  }
}

int main (){

  int i,j,k,n,u;

  for(i=1;i<101;i++){
    for(j=1;j<101;j++){
      A[i][j] = 0;
    }
  }

  scanf("%d",&N);

  for(i=1;i<=N;i++){ 
    scanf("%d %d",&n,&k); 
    for(j=1;j<=k;j++){
      scanf("%d",&u);
      A[n][u] = 1;
    }
  }

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

  return 0;
}

Compiler output:
main.c: In function 'DFSvisit':
main.c:10:11: error: 'g' undeclared (first use in this function)
   10 |   temp[u]=g;
      |           ^
main.c:10:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:17: error: 'w' undeclared (first use in this function)
   18 |     if(temp[v]==w){
      |                 ^
main.c:23:13: error: 'b' undeclared (first use in this function)
   23 |   temp[u] = b;
      |             ^
main.c: In function 'DFS':
main.c:30:15: error: 'w' undeclared (first use in this function)
   30 |     temp[i] = w;
      |               ^
main.c: In function 'main':
main.c:52:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   52 |   scanf("%d",&N);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int temp[101],d[101],f[101];
main.c:52:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   52 |   scanf("%d",&N);
      |   ^~~~~
main.c:52:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:64:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   64 |     printf("%d %d %d\n",i,d[i],f[i]);
      |     ^~~~~~
main.c:64:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:64:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:64:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#define N 100
#define WHITE 0
#define BLACK 1
#define GRAY 2

int n,time;
int d[N+1],f[N+1],G[N+1][N+1],C[N+1];

void Dfs(void){
 
  int i;

  for(i=1;i<=n;i++){
    C[i]=WHITE;
  }

  time=0;

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

void Dfsvisit(int u){

  int v;

  C[u]=GRAY;
  d[u]=++time;

  for(v=1;v<=n;v++){
    if(G[u][v]==2){
      if(C[v]==WHITE){
	Dfsvistit(v);
      }
    }
  }

  C[u]=BLACK;
  f[u]=++time;
}

int main(){

  int i,j,k,id,l;

  scanf("%d",&n);

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

  for(i=1;i<=n;i++){
    scanf("%d%d",&id,&k);
    for(j=0;j<k;j++){
      scanf("%d",&l);
      G[i][l]=2;
    }
  }

  Dfs();

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

Compiler output:
main.c: In function 'Dfs':
main.c:22:7: error: implicit declaration of function 'Dfsvisit' [-Wimplicit-function-declaration]
   22 |       Dfsvisit(i);
      |       ^~~~~~~~
main.c: At top level:
main.c:27:6: warning: conflicting types for 'Dfsvisit'; have 'void(int)'
   27 | void Dfsvisit(int u){
      |      ^~~~~~~~
main.c:22:7: note: previous implicit declaration of 'Dfsvisit' with type 'void(int)'
   22 |       Dfsvisit(i);
      |       ^~~~~~~~
main.c: In function 'Dfsvisit':
main.c:37:9: error: implicit declaration of function 'Dfsvistit'; did you mean 'Dfsvisit'? [-Wimplicit-function-declaration]
   37 |         Dfsvistit(v);
      |         ^~~~~~~~~
      |         Dfsvisit
Language: C

#include<stdio.h>
 
int d[100];
int f[100];
int n;
int graph[100][100]={0};
 
int time=1;
 
int dood(int node){
    d[node]=time++;
    int i,j;
    for(i=0;i<n;i++){
        if(graph[node][i]==1 && d[i]==0){
            dfs(i);
        }
    }
    f[node]=time++;
}
 
int main(void){
    int u, k, v;
    int i, j;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d %d",&u,&k);
        for(j=0;j<k;j++){
            scanf("%d",&v);
            graph[u-1][v-1]=1;
        }
    }
    dood(0);
    for(i=0;i<n;i++){
        if(d[i]==0){
            dfs(i);
        }
    }
    for(i=0;i<n;i++){
        printf("%d %d %d\n",i+1,d[i],f[i]);
    }
    return 0;
}

Compiler output:
main.c: In function 'dood':
main.c:15:13: error: implicit declaration of function 'dfs' [-Wimplicit-function-declaration]
   15 |             dfs(i);
      |             ^~~
Language: C

include<stdio.h>
#define BLACK 2
#define WHITE 0
#define GRAY 1
#define N 101

int V[N][N];
int mark[N],d[N],f[N],n,count;

void dfs_visit(int u){
  int v;
  mark[u]=GRAY;
  d[u]=++count;
  for(v=1;v<=n;v++){
    if(V[u][v]==0) continue;
    if(mark[v]==WHITE){
      dfs_visit(v);
    }
  }
  mark[u]=BLACK;
  f[u]==++count;
}

void dfs(){
  int u;
  for(u=1;u<=n;u++) mark[u]=WHITE;
  count=0;

  for(u=1;u<=n;u++){
    if(mark[u]==WHITE) dfs_visit(u);
  }

  for(u=1;u<=n;u++){
    printf("%d %d %d\n",u,d[u],f[u]);
  }
int main(){

  int i,j,n,t,s,u;

  scanf("%d",&n);

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

  for(i=1;i<=n;i++){
    scanf("%d",&u);
    scanf("%d",&t);
    for(j=1;j<=t;j++){
      scanf("%d",&s);
      V[u][s]=1;
    }
  }

  dfs();

  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'dfs_visit':
main.c:15:8: error: 'V' undeclared (first use in this function)
   15 |     if(V[u][v]==0) continue;
      |        ^
main.c:15:8: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dfs':
main.c:34:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   34 |     printf("%d %d %d\n",u,d[u],f[u]);
      |     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:34:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   34 |     printf("%d %d %d\n",u,d[u],f[u]);
      |     ^~~~~~
main.c:34:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'main':
main.c:40:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   40 |   scanf("%d",&n);
      |   ^~~~~
main.c:40:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:40:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:40:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:44:7: error: 'V' undeclared (first use in this function)
   44 |       V[i][j]=0;
      |       ^
main.c: In function 'dfs':
main.c:59:1: error: expected declaration or statement at end of input
   59 | }
      | ^
Language: C

include<stdio.h>
#define BLACK 2
#define WHITE 0
#define GRAY 1
#define N 101

int V[N][N];
int mark[N],d[N],f[N],n,count;

void dfs_visit(int u){
  int v;
  mark[u]=GRAY;
  d[u]=++count;
  for(v=1;v<=n;v++){
    if(V[u][v]==0) continue;
    if(mark[v]==WHITE){
      dfs_visit(v);
    }
  }
  mark[u]=BLACK;
  f[u]==++count;
}

void dfs(){
  int u;
  for(u=1;u<=n;u++) mark[u]=WHITE;
  count=0;

  for(u=1;u<=n;u++){
    if(mark[u]==WHITE) dfs_visit(u);
  }

  for(u=1;u<=n;u++){
    printf("%d %d %d\n",u,d[u],f[u]);
  }
}
int main(){

  int i,j,n,t,s,u;

  scanf("%d",&n);

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

  for(i=1;i<=n;i++){
    scanf("%d",&u);
    scanf("%d",&t);
    for(j=1;j<=t;j++){
      scanf("%d",&s);
      V[u][s]=1;
    }
  }

  dfs();

  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'dfs_visit':
main.c:15:8: error: 'V' undeclared (first use in this function)
   15 |     if(V[u][v]==0) continue;
      |        ^
main.c:15:8: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dfs':
main.c:34:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   34 |     printf("%d %d %d\n",u,d[u],f[u]);
      |     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:34:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   34 |     printf("%d %d %d\n",u,d[u],f[u]);
      |     ^~~~~~
main.c:34:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'main':
main.c:41:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   41 |   scanf("%d",&n);
      |   ^~~~~
main.c:41:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:41:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:41:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:45:7: error: 'V' undeclared (first use in this function)
   45 |       V[i][j]=0;
      |       ^
Language: C

void dfs(Graph *f){

  int u;
  int color[N];

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

  time = 0;

  for(u=0; u<n; u++){
    if(color[u] == WHITE){
      visit(u);
    }
  }
}

void visit(int x){

  int v, u;
  int color[N], d[N], f[N];

  //push(u);
  color[u] = GRAY;
  d[u] = ++time;

  for(v=0; v<n; v++){
    if(color[v] == WHITE){
      visit(v);
    }
    //printf("%d %d %d\n", v, d[v], f[v]); //?????????????????????????????°???
  }

  /* while(1){
     u = */

  color[u] = BLACK;
  f[u] = ++time;

  printf("%d %d %d\n", v, d[v], f[v]);

}

 
/*int isEmpty(void){
  if (top == 0) return 1;
  else return 0;
}
 
int isFull(void){
  if(top > N-1) return 1;
  else return 0;
}
 
int push(int x){
  if(isFull() == 0){
  top++;
  s[top] = x;
  }
}
 
int pop(void){
  if (isEmpty() == 0){
    top--;
  return s[top + 1];
  }
}
*/

Compiler output:
main.c:1:10: error: unknown type name 'Graph'
    1 | void dfs(Graph *f){
      |          ^~~~~
main.c: In function 'visit':
main.c:22:13: error: 'N' undeclared (first use in this function)
   22 |   int color[N], d[N], f[N];
      |             ^
main.c:22:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:25:14: error: 'GRAY' undeclared (first use in this function)
   25 |   color[u] = GRAY;
      |              ^~~~
main.c:26:12: error: 'time' undeclared (first use in this function)
   26 |   d[u] = ++time;
      |            ^~~~
main.c:1:1: note: 'time' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
  +++ |+#include <time.h>
    1 | void dfs(Graph *f){
main.c:28:14: error: 'n' undeclared (first use in this function)
   28 |   for(v=0; v<n; v++){
      |              ^
main.c:29:20: error: 'WHITE' undeclared (first use in this function)
   29 |     if(color[v] == WHITE){
      |                    ^~~~~
main.c:38:14: error: 'BLACK' undeclared (first use in this function)
   38 |   color[u] = BLACK;
      |              ^~~~~
main.c:41:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   41 |   printf("%d %d %d\n", v, d[v], f[v]);
      |   ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | void dfs(Graph *f){
main.c:41:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   41 |   printf("%d %d %d\n", v, d[v], f[v]);
      |   ^~~~~~
main.c:41:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#define N 100
#define W 1
#define G 2
#define B 3

int n,d[N],f[N],time,S[N],G[N][N];

void DFS(void);
void DFSvisit(int);

int main(){
  int i,j,u,v,k;

  scanf("%d",&n);

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

  DFS();

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

  return 0;
}





void DFS(void){
  int i;
  
  for(i=0;i<n;i++){
    S[i]=W;
  }
  time=0;
  for(i=0;i<n;i++){
    if(S[i]==W){
      DFSvisit(i);
    }
  }
}





void DFSvisit(int u){
  int i;

  S[u]=G;
  d[u]=++time;

  for(i=0;i<n;i++){
    if(G[u][i]==1 && S[i]==W){
      DFSvisit(i);
    }
  }

  
  S[u]=B;
  f[u]=++time;
}

Compiler output:
main.c:4:11: error: expected identifier or '(' before numeric constant
    4 | #define G 2
      |           ^
main.c:7:27: note: in expansion of macro 'G'
    7 | int n,d[N],f[N],time,S[N],G[N][N];
      |                           ^
main.c: In function 'main':
main.c:19:8: error: subscripted value is neither array nor pointer nor vector
   19 |       G[i][j]=0;
      |        ^
main.c:27:8: error: subscripted value is neither array nor pointer nor vector
   27 |       G[u-1][v-1]=1;
      |        ^
main.c: In function 'DFSvisit':
main.c:69:9: error: subscripted value is neither array nor pointer nor vector
   69 |     if(G[u][i]==1 && S[i]==W){
      |         ^
Language: C

#include <stdio.h>
#define N 100

int n;
int G[N][N]
int H[N], f[N], d[N];
int t=0;

void DFS(int a){
  int i;
  for(i = 1; i <= n; i++){
    if (G[a][i] == 1 && H[i] == 0){
      H[i] = 1;
      t++;
      d[i] = t;
      DFS(i);
    }
  }
  t++;
  f[a] = t;
}

int main()
{
  int i, j, u, k, v;

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

  for(i = 1; i <= n; i++){
    if (H[i] == 0){
      t++;
      d[i] = t;
      H[i] = 1;
      DFS(i);
    }
  }

  for(i = 1; i <= n; i++)
     printf("%d %d %d\n", i, d[i], f[i]);

  return 0;
}

Compiler output:
main.c:5:12: error: expected ';' before 'int'
    5 | int G[N][N]
      |            ^
      |            ;
    6 | int H[N], f[N], d[N];
      | ~~~         
main.c: In function 'DFS':
main.c:12:9: error: 'G' undeclared (first use in this function)
   12 |     if (G[a][i] == 1 && H[i] == 0){
      |         ^
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:32:7: error: 'G' undeclared (first use in this function)
   32 |       G[u][v] = 1;
      |       ^
Language: C

#include <stdio.h>
#define N 100
#define WHITE 0;
#define GRAY 1;
"define BRACK 2;

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

void dfs_visit(int u){
  int v;
  color[u] = GRAY;
  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 u;
  for ( u = 0; u < n; u++ ) color[u] = WHITE;
  tt = 0;
  
  for ( u = 0; u < n; u++) {
    if (color[u] == WHITE ) dfs_visit(u);
  }
  for ( u = 0; u < n; u++ ) {
    printf("%d %d %d\n", u + 1, d[u], f[u]);
  }
}

int main() {
  int u, v, k, 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;
}

Compiler output:
main.c:5:1: warning: missing terminating " character
    5 | "define BRACK 2;
      | ^
main.c:5:1: error: missing terminating " character
    5 | "define BRACK 2;
      | ^~~~~~~~~~~~~~~~
main.c: In function 'dfs_visit':
main.c:3:16: error: expected ')' before ';' token
    3 | #define WHITE 0;
      |                ^
main.c:16:22: note: in expansion of macro 'WHITE'
   16 |     if ( color[v] == WHITE ){
      |                      ^~~~~
main.c:16:8: note: to match this '('
   16 |     if ( color[v] == WHITE ){
      |        ^
main.c:20:14: error: 'BLACK' undeclared (first use in this function)
   20 |   color[u] = BLACK;
      |              ^~~~~
main.c:20:14: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dfs':
main.c:3:16: error: expected ')' before ';' token
    3 | #define WHITE 0;
      |                ^
main.c:31:21: note: in expansion of macro 'WHITE'
   31 |     if (color[u] == WHITE ) dfs_visit(u);
      |                     ^~~~~
main.c:31:8: note: to match this '('
   31 |     if (color[u] == WHITE ) dfs_visit(u);
      |        ^
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], tt;

void dfs_visit(int u) {
   int v;

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

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

void dfs() {
   int u;

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

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

int main() {
   int u, v, k, i, j;

   scanf("%d %d", &u, &k);
   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;
}

Compiler output:
main.c: In function 'dfs_visit':
main.c:17:12: error: subscripted value is neither array nor pointer nor vector
   17 |       if (N[u][v] == 0) {
      |            ^
main.c:21:19: error: subscripted value is neither array nor pointer nor vector
   21 |          dfs_visit[v];
      |                   ^
main.c: In function 'dfs':
main.c:43:32: error: 'i' undeclared (first use in this function)
   43 |       printf("%d %d %d\n", u + i, d[u], f[u]);
      |                                ^
main.c:43:32: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define N 100
#define WHITE 0;
#define GRAY 1;
#define BRACK 2;

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

void dfs_visit(int u){
  int v;
  color[u] = GRAY;
  d[u] = ++tt;
  for( v = 0; v < n; v++ ){
    if ( M[u][v] == 0 ) { continue; }
    if ( color[v] == WHITE ){
      dfs_visit(v);
    }
  }
  color[u] = BRACK;
  f[u] = ++tt;
  
}

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

int main() {
  int u, v, k, 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;
}

Compiler output:
main.c: In function 'dfs_visit':
main.c:3:16: error: expected ')' before ';' token
    3 | #define WHITE 0;
      |                ^
main.c:16:22: note: in expansion of macro 'WHITE'
   16 |     if ( color[v] == WHITE ){
      |                      ^~~~~
main.c:16:8: note: to match this '('
   16 |     if ( color[v] == WHITE ){
      |        ^
main.c: In function 'dfs':
main.c:3:16: error: expected ')' before ';' token
    3 | #define WHITE 0;
      |                ^
main.c:31:21: note: in expansion of macro 'WHITE'
   31 |     if (color[u] == WHITE ) { dfs_visit(u); }
      |                     ^~~~~
main.c:31:8: note: to match this '('
   31 |     if (color[u] == WHITE ) { dfs_visit(u); }
      |        ^
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], tt;

void dfs_visit(int u) {
   int v;

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

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

void dfs() {
   int u;

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

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

int main() {
   int u, v, k, i, j;

   scanf("%d %d", &u, &k);
   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;
}

Compiler output:
main.c: In function 'dfs_visit':
main.c:17:12: error: subscripted value is neither array nor pointer nor vector
   17 |       if (N[u][v] == 0) {
      |            ^
main.c:21:19: error: subscripted value is neither array nor pointer nor vector
   21 |          dfs_visit[v];
      |                   ^
Language: C

#include<stdio.h>
#define MAX 100
??

int g[MAX][MAX], labels[MAX], n, d[MAX], f[MAX], time;
??
??
void dfs(int u) {
????????int v;
????????labels[u] = 1;
????????d[u] = ++time;
????????for(v=0; v<n; v++){
????????if (g[u][v] && labels[v] == 0) {
????????????????dfs(v);
????????}
????????}
????????labels[u] = 2;
????????f[u] = ++time;
??????????
}
??
int main() {
??????????
????????int i,u,k,v,j;
????????scanf("%d",&n);
????????for(i=0;i<MAX;i++){
????????for(j=0;j<n;j++){
????????????????g[i][j]=0;
????????}
????????}
????????for(i=0;i<n;i++){
????????scanf("%d %d",&u, &k);
????????for(j=0;j<k;j++){
????????????????scanf("%d",&v);
????????????????g[u-1][v-1]=1;
????????}
????????}
??
????????time = 0;
??????????
????????for(i=0; i<MAX; i++) {
????????labels[i]=0;
????????}
??????????
??
??????????????for(i=0; i<n; i++) {
????????if (labels[i]==0) dfs(i);
????????}
??????
??
????????for(i=0; i<n; i++){
????????printf("%d %d %d\n", i+1, d[i], f[i]);
????????}
??????????
????????return 0;
??
??????????
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??
      | ^
main.c:6:1: error: expected identifier or '(' before '?' token
    6 | ??
      | ^
main.c:21:1: error: expected identifier or '(' before '?' token
   21 | ??
      | ^
Language: C

#include<stdio.h>
#define MAX 100
??
/*
????unvisited 0
????visited 1
????finished search 2
??????
??*/
int g[MAX][MAX], labels[MAX], n, d[MAX], f[MAX], time;
??
??
void dfs(int u) {
????????int v;
????????labels[u] = 1;
????????d[u] = ++time;
????????for(v=0; v<n; v++){
????????if (g[u][v] && labels[v] == 0) {
????????????????dfs(v);
????????}
????????}
????????labels[u] = 2;
????????f[u] = ++time;
??????????
}
??
int main() {
??????????
????????int i,u,k,v,j;
????????scanf("%d",&n);
????????for(i=0;i<MAX;i++){
????????for(j=0;j<n;j++){
????????????????g[i][j]=0;
????????}
????????}
????????for(i=0;i<n;i++){
????????scanf("%d %d",&u, &k);
????????for(j=0;j<k;j++){
????????????????scanf("%d",&v);
????????????????g[u-1][v-1]=1;
????????}
????????}
??
????????time = 0;
??????????
????????for(i=0; i<MAX; i++) {
????????labels[i]=0;
????????}
??????????
??
????????for(i=0; i<n; i++) {
????????if (labels[i]==0) dfs(i);
????????}

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

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??
      | ^
main.c:11:1: error: expected identifier or '(' before '?' token
   11 | ??
      | ^
main.c:26:1: error: expected identifier or '(' before '?' token
   26 | ??
      | ^
Language: C

#include <stdio.h>
#define N 1000
#define WHITE 0
#define BLACK 1
#define GRAY 2
??
int A[N][N],color[N],d[N],f[N],k[N];
int n,u,time;
??
??
void visit(int r){
??
????int i;
??
????color[r] = GRAY;
????d[r] = ++time;
????for(i=1;i<=k[r];i++){
????????if(color[A[r][i]] == WHITE){
????????????visit(A[r][i]);
????????}
????}
????color[r] = BLACK;
????f[r] = ++time;
}
??
void dfs(void){
??????
????int i;
??????
????for(i=1;i<=n;i++){
????????color[i] = WHITE;
????}
????time = 0;
????for(i=1;i<=n;i++){
????????if(color[i] == WHITE){
????????????visit(i);
????????}
????}
}
??
??
int main(void){
??
????int i,j;
??
????scanf("%d",&n);
??
????for(i=1;i<=n;i++){
????????scanf("%d %d",&u,&k[i]);
????????for(j=1;j<=k[i];j++){
????????????scanf("%d",&A[i][j]);
????????}
????}
????dfs();
????for(i=1;i<=n;i++){
????????printf("%d %d %d\n",i,d[i],f[i]);
????}
????return 0;
}

Compiler output:
main.c:6:1: error: expected identifier or '(' before '?' token
    6 | ??
      | ^
main.c:9:1: error: expected identifier or '(' before '?' token
    9 | ??
      | ^
main.c:25:1: error: expected identifier or '(' before '?' token
   25 | ??
      | ^
main.c:40:1: error: expected identifier or '(' before '?' token
   40 | ??
      | ^
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], tt;


void dfs_visit(int u) {
  int v;
  color[u] = GRAY;
  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 u;

  for (u=0; u < n; u++) color[u] = WHITE;
  tt = 0;


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

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

int main() {
  int u, v, k, 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;
}

Compiler output:
main.c: In function 'dfs':
main.c:29:3: error: expected declaration specifiers before 'for'
   29 |   for (u=0; u < n; u++) color[u] = WHITE;
      |   ^~~
main.c:29:13: error: expected declaration specifiers before 'u'
   29 |   for (u=0; u < n; u++) color[u] = WHITE;
      |             ^
main.c:29:20: error: expected declaration specifiers before 'u'
   29 |   for (u=0; u < n; u++) color[u] = WHITE;
      |                    ^
main.c:30:3: error: expected declaration specifiers before 'tt'
   30 |   tt = 0;
      |   ^~
main.c:33:3: error: expected declaration specifiers before 'for'
   33 |   for (u=0; u < n; u++) {
      |   ^~~
main.c:33:13: error: expected declaration specifiers before 'u'
   33 |   for (u=0; u < n; u++) {
      |             ^
main.c:33:20: error: expected declaration specifiers before 'u'
   33 |   for (u=0; u < n; u++) {
      |                    ^
main.c:37:3: error: expected declaration specifiers before 'for'
   37 |   for (u=0; u < n; u++) {
      |   ^~~
main.c:37:13: error: expected declaration specifiers before 'u'
   37 |   for (u=0; u < n; u++) {
      |             ^
main.c:37:20: error: expected declaration specifiers before 'u'
   37 |   for (u=0; u < n; u++) {
      |                    ^
main.c:40:1: error: expected declaration specifiers before '}' token
   40 | }
      | ^
main.c:42:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   42 | int main() {
      |            ^
main.c:27:7: error: declaration for parameter 'u' but no such parameter
   27 |   int u;
      |       ^
main.c:65: error: expected '{' at end of input
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],tt;

void dfs_visit(int u) {
  int v;
  color[u] = GRAY;
  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 u;
  for(u = 0;u<n;u++) color[u] = WHITE;
  tt = 0;

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

int main() {
  int u,v,k,i,j;

  scanf("%d\n", &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\n",&u,&k );
    u--;
    for(j=0;j<k;j++) {
      scanf("%d\n", &v);
      v--;
      M[u][v] = 1;
    }
  }
  dfs();

  return 0;
}
#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],tt;

void dfs_visit(int u) {
  int v;
  color[u] = GRAY;
  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 u;
  for(u = 0;u<n;u++) color[u] = WHITE;
  tt = 0;

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

int main() {
  int u,v,k,i,j;

  scanf("%d\n", &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\n",&u,&k );
    u--;
    for(j=0;j<k;j++) {
      scanf("%d\n", &v);
      v--;
      M[u][v] = 1;
    }
  }
  dfs();

  return 0;
}

Compiler output:
main.c:67:6: error: redefinition of 'dfs_visit'
   67 | void dfs_visit(int u) {
      |      ^~~~~~~~~
main.c:10:6: note: previous definition of 'dfs_visit' with type 'void(int)'
   10 | void dfs_visit(int u) {
      |      ^~~~~~~~~
main.c:81:6: error: redefinition of 'dfs'
   81 | void dfs() {
      |      ^~~
main.c:24:6: note: previous definition of 'dfs' with type 'void()'
   24 | void dfs() {
      |      ^~~
main.c:94:5: error: redefinition of 'main'
   94 | int main() {
      |     ^~~~
main.c:37:5: note: previous definition of 'main' with type 'int()'
   37 | int main() {
      |     ^~~~
Language: C

#include <stdbool.h>
#include <stdint.h>

typedef enum {
  WHITE,
  GRAY,
} color_t;

typedef struct {
  uint32_t index;
  size_t len;
  uint32_t array[GRAPH_MATRIX_SIZE];
  color_t color;
} graph_vertex_t;


void graph_depth_first_search(graph_vertex_t *vertexes, uint32_t index, graph_depth_first_search_callback_t callback_pre,
                              graph_depth_first_search_callback_t callback_post)
{
  if (vertexes == NULL) return;
  graph_vertex_t *vertex = &vertexes[index - 1];
  vertex->color = GRAY;
  if (callback_pre) callback_pre(vertex->index);

  if (vertex->len > 0) {
    uint32_t i;
    for (i = 0; i < vertex->len; i++) {
      uint32_t next_vertex_index = vertex->array[i];
      if (vertexes[next_vertex_index - 1].color == WHITE) {
        graph_depth_first_search(vertexes, next_vertex_index, callback_pre, callback_post);
      }
    }
  }
  if (callback_post) callback_post(vertex->index);

  return;
}

#if !defined(TEST)
#include <stdio.h>
#define VERTEXES 256
static graph_vertex_t vertexes[VERTEXES];
static uint32_t cnt = 0;
static uint32_t timestamp[VERTEXES][2];

static void callback_pre(uint32_t index)
{
  cnt++;
  timestamp[index - 1][0] = cnt;
}

static void callback_post(uint32_t index)
{
  cnt++;
  timestamp[index - 1][1] = cnt;
}

int32_t main(void)
{
  uint32_t num;
  scanf("%u", &num);

  uint32_t i, j;
  for (i = 0; i < num; i++) {
    scanf("%u", &vertexes[i].index);
    scanf("%lu", &vertexes[i].len);
    for (j = 0; j < vertexes[i].len; j++) {
      scanf("%u", &vertexes[i].array[j]);
    }
    vertexes[i].color = WHITE;
  }

  graph_depth_first_search(vertexes, 1, callback_pre, callback_post);
  for (i = 0; i < num; i++) {
    printf("%d %d %d\n", i + 1, timestamp[i][0], timestamp[i][1]);
  }
  return 0;
}
#endif

Compiler output:
main.c:11:3: error: unknown type name 'size_t'
   11 |   size_t len;
      |   ^~~~~~
main.c:3:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
    2 | #include <stdint.h>
  +++ |+#include <stddef.h>
    3 | 
main.c:12:18: error: 'GRAPH_MATRIX_SIZE' undeclared here (not in a function)
   12 |   uint32_t array[GRAPH_MATRIX_SIZE];
      |                  ^~~~~~~~~~~~~~~~~
main.c:17:73: error: unknown type name 'graph_depth_first_search_callback_t'
   17 | void graph_depth_first_search(graph_vertex_t *vertexes, uint32_t index, graph_depth_first_search_callback_t callback_pre,
      |                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:18:31: error: unknown type name 'graph_depth_first_search_callback_t'
   18 |                               graph_depth_first_search_callback_t callback_post)
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c: In function 'main':
main.c:73:3: error: implicit declaration of function 'graph_depth_first_search' [-Wimplicit-function-declaration]
   73 |   graph_depth_first_search(vertexes, 1, callback_pre, callback_post);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include <stdbool.h>
#include <stdint.h>

#define GRAPH_MATRIX_SIZE 256

typedef enum {
  WHITE,
  GRAY,
} color_t;

typedef struct {
  uint32_t index;
  size_t len;
  uint32_t array[GRAPH_MATRIX_SIZE];
  color_t color;
} graph_vertex_t;


void graph_depth_first_search(graph_vertex_t *vertexes, uint32_t index, graph_depth_first_search_callback_t callback_pre,
                              graph_depth_first_search_callback_t callback_post)
{
  if (vertexes == NULL) return;
  graph_vertex_t *vertex = &vertexes[index - 1];
  vertex->color = GRAY;
  if (callback_pre) callback_pre(vertex->index);

  if (vertex->len > 0) {
    uint32_t i;
    for (i = 0; i < vertex->len; i++) {
      uint32_t next_vertex_index = vertex->array[i];
      if (vertexes[next_vertex_index - 1].color == WHITE) {
        graph_depth_first_search(vertexes, next_vertex_index, callback_pre, callback_post);
      }
    }
  }
  if (callback_post) callback_post(vertex->index);

  return;
}

#if !defined(TEST)
#include <stdio.h>
#define VERTEXES 256
static graph_vertex_t vertexes[VERTEXES];
static uint32_t cnt = 0;
static uint32_t timestamp[VERTEXES][2];

static void callback_pre(uint32_t index)
{
  cnt++;
  timestamp[index - 1][0] = cnt;
}

static void callback_post(uint32_t index)
{
  cnt++;
  timestamp[index - 1][1] = cnt;
}

int32_t main(void)
{
  uint32_t num;
  scanf("%u", &num);

  uint32_t i, j;
  for (i = 0; i < num; i++) {
    scanf("%u", &vertexes[i].index);
    scanf("%lu", &vertexes[i].len);
    for (j = 0; j < vertexes[i].len; j++) {
      scanf("%u", &vertexes[i].array[j]);
    }
    vertexes[i].color = WHITE;
  }

  graph_depth_first_search(vertexes, 1, callback_pre, callback_post);
  for (i = 0; i < num; i++) {
    printf("%d %d %d\n", i + 1, timestamp[i][0], timestamp[i][1]);
  }
  return 0;
}
#endif

Compiler output:
main.c:13:3: error: unknown type name 'size_t'
   13 |   size_t len;
      |   ^~~~~~
main.c:3:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
    2 | #include <stdint.h>
  +++ |+#include <stddef.h>
    3 | 
main.c:19:73: error: unknown type name 'graph_depth_first_search_callback_t'
   19 | void graph_depth_first_search(graph_vertex_t *vertexes, uint32_t index, graph_depth_first_search_callback_t callback_pre,
      |                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:20:31: error: unknown type name 'graph_depth_first_search_callback_t'
   20 |                               graph_depth_first_search_callback_t callback_post)
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c: In function 'main':
main.c:75:3: error: implicit declaration of function 'graph_depth_first_search' [-Wimplicit-function-declaration]
   75 |   graph_depth_first_search(vertexes, 1, callback_pre, callback_post);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<stack>
using namespace std;
int main(){
    int n,u,k,v;
    int M[100][100];
    stack<int> S;

    cin >> n;
    for(int i=0;i<n;i++){
	cin >> u;
	u--;
	cin >> k;
	for(int j=0;j<k;j++){
	    cin >> v;
	    v--;
	    M[u][v]=1;
	}
    }

    int time=0;
    int d[100]={0},f[100]={0};
    bool found;
    int i;

    S.push(0);
    while(!S.empty()){
	if(d[S.top()]==0) d[S.top()]=++time;
	found=false;
	for(i=0;i<n;i++){
	    if(d[i]==0 && M[S.top()][i]==1){
		found=true;
		break;
	    }
	}
	if(found) S.push(i);
	else {
	    f[S.top()]=++time;
	    S.pop();
	}
    }

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

    return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

void visit(int);
int t=0,n;
int array[N][N], road_color[N] ,arr1[N], time[N];
int main(){
  int i,j,num1,num2,num3;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      array[i][j] = 0;
    }
  }
  for(i=0;i<n;i++){
    scanf("%d %d",&num1,&num2);
    num1--;
    for(j=0;j<num2;j++){
      scanf("%d",&num3);
      num3--;
      array[num1][num3] = 1;
    }
  }
  for(i=0;i<n;i++) road_color[i] = WHITE;
 
  for(i=0;i<n;i++)  if(road_color[i] == WHITE) visit(i);
 
  for(i=0;i<n;i++) printf("%d %d %d\n", i+1,arr1[i],time[i]);
 
  return 0;
}
void visit(int u){
  int i;
  road_color[u] = GRAY;
  arr1[u] = ++t;
  for(i=0;i<n;i++){
    if(array[u][i] == 0) continue;
    if(road_color[i] == WHITE) visit(i);
  }
    road_color[i] = BRACK;
    time[u]=++t;
}

Compiler output:
main.c:3:11: error: 'N' undeclared here (not in a function)
    3 | int array[N][N], road_color[N] ,arr1[N], time[N];
      |           ^
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | void visit(int);
main.c:6:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |   scanf("%d",&n);
      |   ^~~~~
main.c:6:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:21:36: error: 'WHITE' undeclared (first use in this function)
   21 |   for(i=0;i<n;i++) road_color[i] = WHITE;
      |                                    ^~~~~
main.c:21:36: note: each undeclared identifier is reported only once for each function it appears in
main.c:25:20: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |   for(i=0;i<n;i++) printf("%d %d %d\n", i+1,arr1[i],time[i]);
      |                    ^~~~~~
main.c:25:20: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:20: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:20: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'visit':
main.c:31:19: error: 'GRAY' undeclared (first use in this function)
   31 |   road_color[u] = GRAY;
      |                   ^~~~
main.c:35:25: error: 'WHITE' undeclared (first use in this function)
   35 |     if(road_color[i] == WHITE) visit(i);
      |                         ^~~~~
main.c:37:21: error: 'BRACK' undeclared (first use in this function)
   37 |     road_color[i] = BRACK;
      |                     ^~~~~
Language: C

#include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2

void dfsvisit(int);
void dfs(void);

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

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 dfsvisit(int u){
int v;
color[u]=GRAY;
d[u]=++t;
for(v=0;v<n;v++){
if(M[u][v]==0)continue;
if(color[v]==WHITE)dfsvisit(v);
}
color[u]=BLACK;
f[u]=++t;
}

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

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

Compiler output:
main.c:12:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
   12 | int t;
      | ^~~
main.c:14:1: error: return type defaults to 'int' [-Wimplicit-int]
   14 | main(){
      | ^~~~
main.c: In function 'dfsvisit':
main.c:40:8: error: 't' undeclared (first use in this function)
   40 | d[u]=++t;
      |        ^
main.c:40:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:46:1: error: 'f' undeclared (first use in this function)
   46 | f[u]=++t;
      | ^
main.c: In function 'dfs':
main.c:52:1: error: 't' undeclared (first use in this function)
   52 | t=0;
      | ^
main.c:58:30: error: 'f' undeclared (first use in this function)
   58 | printf("%d %d %d\n",u+1,d[u],f[u]);
      |                              ^
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 t;

void dfsvisit(int);
void dfs(void);

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 dfsvisit(int u){
int v;
color[u]=GRAY;
d[u]=++t;
for(v=0;v<n;v++){
if(M[u][v]==0)continue;
if(color[v]==WHITE)dfsvisit(v);
}
color[u]=BLACK;
f[u]=++t;
}

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

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

Compiler output:
main.c:9:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
    9 | int t;
      | ^~~
main.c:14:1: error: return type defaults to 'int' [-Wimplicit-int]
   14 | main(){
      | ^~~~
main.c: In function 'dfsvisit':
main.c:40:8: error: 't' undeclared (first use in this function)
   40 | d[u]=++t;
      |        ^
main.c:40:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:46:1: error: 'f' undeclared (first use in this function)
   46 | f[u]=++t;
      | ^
main.c: In function 'dfs':
main.c:52:1: error: 't' undeclared (first use in this function)
   52 | t=0;
      | ^
main.c:58:30: error: 'f' undeclared (first use in this function)
   58 | printf("%d %d %d\n",u+1,d[u],f[u]);
      |                              ^
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 t;

void dfsvisit(int u){
int v;
color[u]=GRAY;
d[u]=++t;
for(v=0;v<n;v++){
if(M[u][v]==0)continue;
if(color[v]==WHITE)dfsvisit(v);
}
color[u]=BLACK;
f[u]=++t;
}

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

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

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;
}

Compiler output:
main.c:9:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
    9 | int t;
      | ^~~
main.c: In function 'dfsvisit':
main.c:14:8: error: 't' undeclared (first use in this function)
   14 | d[u]=++t;
      |        ^
main.c:14:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:1: error: 'f' undeclared (first use in this function)
   20 | f[u]=++t;
      | ^
main.c: In function 'dfs':
main.c:26:1: error: 't' undeclared (first use in this function)
   26 | t=0;
      | ^
main.c:32:30: error: 'f' undeclared (first use in this function)
   32 | printf("%d %d %d\n",u+1,d[u],f[u]);
      |                              ^
main.c: At top level:
main.c:36:1: error: return type defaults to 'int' [-Wimplicit-int]
   36 | main(){
      | ^~~~