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

#include <stdio.h>
#define MAX 101
#define WHITE 0
#define GLAY 1
#define BLACK 2

int n,V[MAX][MAX];
int color[MAX];
int time;
int d[MAX],f[MAX];

void DFS(int id){
  int i;
  for(i=1;i<=n;i++){
    color[id] = WHITE;
  }
  time = 0;
  
  for(i=1;i<=n;i++){
    if(color[id] == WHITE){
      Visit(id);
    }
  }
  for(i=1;i<=n;i++){
    prinrf("%d %d %d\n",i,d[i],f[i]);
  }
};

void Visit(int u){
  int v;

  color[u] = GRAY;
  d[u] = ++time;
  
  for(v=1;v<=n;v++){    
    if(V[u][v]==0)continue;
    
    if(color[v]==WHITE){
      Visit(v);
    }
  }
  
  color[u] = BLACK;
  f[u] = ++time;
};

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

  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%d",&id,&k);
    for(j=1;j<=k;j++){
      scanf("%d",&v);
      V[id][v]=1;
    }
  }

  DFS();

  return 0;
}

Compiler output:
main.c: In function 'DFS':
main.c:21:7: error: implicit declaration of function 'Visit' [-Wimplicit-function-declaration]
   21 |       Visit(id);
      |       ^~~~~
main.c:25:5: error: implicit declaration of function 'prinrf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   25 |     prinrf("%d %d %d\n",i,d[i],f[i]);
      |     ^~~~~~
      |     printf
main.c: At top level:
main.c:29:6: warning: conflicting types for 'Visit'; have 'void(int)'
   29 | void Visit(int u){
      |      ^~~~~
main.c:21:7: note: previous implicit declaration of 'Visit' with type 'void(int)'
   21 |       Visit(id);
      |       ^~~~~
main.c: In function 'Visit':
main.c:32:14: error: 'GRAY' undeclared (first use in this function); did you mean 'GLAY'?
   32 |   color[u] = GRAY;
      |              ^~~~
      |              GLAY
main.c:32:14: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:66:3: error: too few arguments to function 'DFS'
   66 |   DFS();
      |   ^~~
main.c:12:6: note: declared here
   12 | void DFS(int id){
      |      ^~~
Language: C

#include<stdio.h>
#define Black 2
#define GRAY 1
#define WHITE 0
#define N 101
 
int color[N];
int n, G[N][N],f[N],d[N],time;
 
void visit(int u){
  int i; 
  color[u]=GRAY;
  d[u]= ++time;
  for(i=0; i<n; i++){
    if(G[u][i] == 1){
      if(color[i] == WHITE)visit(i);
    }
  }
 
  color[u]= BLACK;
  f[u]=++time;
}

int main(){
  int i,j,v,vnext,k;
  
  scanf("%d",&n);
 
  for(i=0;i<n;i++){
    color[i] = WHITE;
    for(j=0;j<n;j++) {
      G[i][j] = 0;
    }
  }
 
  for(i=0; i<n; i++){
    scanf("%d %d",&v,&k);
    for(j=0; j<k; j++){
      scanf("%d",&vnext);
      G[v-1][vnext-1] = 1; 
    }
  }
 
  for(i=0; i<n; i++){
    if(color[i]==WHITE) 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 'visit':
main.c:20:13: error: 'BLACK' undeclared (first use in this function)
   20 |   color[u]= BLACK;
      |             ^~~~~
main.c:20:13: 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 BLACK 2
 
void dfs(void);
void visit(int);
 
int G[N][N],n,d[N],f[N],color[N],time;
 
int main(void){
  int i,j,k,u,v;
  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);
    u=u-1;
    for(j = 0; j < k; j++){
      scanf("%d",&v);
      v=v-1;
      G[u][v] = 1;
    }
  }
  dfs();
  return 0;
}
  void dfs(){
    int u;
    for(u = 0; u < n; u++) color[u] = WHITE;
    time = 0;
    for(u =0 ; u < n; u++){
      if(color[u] == WHITE) visit(u);
    }
    for( u = 0; u < n; u++){
      printf("%d %d %d\n",u+1,d[u],f[u]);
    }
  }
  void visit(int u){
    int v;
    color[u] = GRAY; 
    d[u] = ++time;
    for(v = 0; v < n; v++){
      if(A[u][v] == 0) continue;
      if(color[v] == WHITE){
    visit(v);
      }
    }
    color[u] = BLACK;
    f[u] = ++time;
  }

Compiler output:
main.c: In function 'visit':
main.c:48:10: error: 'A' undeclared (first use in this function)
   48 |       if(A[u][v] == 0) continue;
      |          ^
main.c:48:10: 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 BLACK 2
 
void dfs(void);
void visit(int);
 
int G[N][N],n,d[N],f[N],color[N],time;
 
int main(void){
  int i,j,k,u,v;
  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);
    u=u-1;
    for(j = 0; j < k; j++){
      scanf("%d",&v);
      v=v-1;
      G[u][v] = 1;
    }
  }
  dfs();
  return 0;
}
void dfs(){
    int u;
    for(u = 0; u < n; u++) color[u] = WHITE;
    time = 0;
    for(u =0 ; u < n; u++){
      if(color[u] == WHITE) visit(u);
    }
    for( u = 0; u < n; u++){
      printf("%d %d %d\n",u+1,d[u],f[u]);
    }
}
void visit(int u){
    int v;
    color[u] = GRAY; 
    d[u] = ++time;
    for(v = 0; v < n; v++){
      if(A[u][v] == 0) continue;
      if(color[v] == WHITE){
    visit(v);
      }
    }
    color[u] = BLACK;
    f[u] = ++time;
}

Compiler output:
main.c: In function 'visit':
main.c:48:10: error: 'A' undeclared (first use in this function)
   48 |       if(A[u][v] == 0) continue;
      |          ^
main.c:48:10: 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 BLACK 2
 
void dfs(void);
void visit(int);
 
int G[N][N],n,d[N],f[N],color[N],time;
 
int main(void){
  int i,j,k,u,v;
  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);
    u--;
    for(j = 0; j < k; j++){
      scanf("%d",&v);
      v--;
      G[u][v] = 1;
    }
  }
  dfs();
  return 0;
}
void dfs(){
    int u;
    for(u = 0; u < n; u++) color[u] = WHITE;
    time = 0;
    for(u =0 ; u < n; u++){
      if(color[u] == WHITE) visit(u);
    }
    for( u = 0; u < n; u++){
      printf("%d %d %d\n",u+1,d[u],f[u]);
    }
}
void visit(int u){
    int v;
    color[u] = GRAY; 
    d[u] = ++time;
    for(v = 0; v < n; v++){
      if(A[u][v] == 0) continue;
      if(color[v] == WHITE){
    visit(v);
      }
    }
    color[u] = BLACK;
    f[u] = ++time;
}

Compiler output:
main.c: In function 'visit':
main.c:48:10: error: 'A' undeclared (first use in this function)
   48 |       if(A[u][v] == 0) continue;
      |          ^
main.c:48:10: 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 BLACK 2
 
void dfs(void);
void visit(int);
 
int G[N][N],n;
int d[N],f[N],color[N],time;
 
int main(){
   int i,j,k,u,v;
  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);
    u--;
    for(j = 0; j < k; j++){
      scanf("%d",&v);
      v--;
      G[u][v] = 1;
    }
  }
  dfs();
  return 0;
}
  void dfs(){
    int u;
    for(u = 0; u < n; u++) color[u] = WHITE;
    time = 0;
    for(u =0 ; u < n; u++){
      if(color[u] == WHITE) visit(u);
    }
    for( u = 0; u < n; u++){
      printf("%d %d %d\n",u+1,d[u],f[u]);
    }
  }
  void visit(int u){
    int v;
    color[u] = GRAY; 
    d[u] = ++time;
    for(v = 0; v < n; v++){
      if(A[u][v] == 0) continue;
      if(color[v] == WHITE){
    visit(v);
      }
    }
    color[u] = BLACK;
    f[u] = ++time;
  }

Compiler output:
main.c: In function 'visit':
main.c:49:10: error: 'A' undeclared (first use in this function)
   49 |       if(A[u][v] == 0) continue;
      |          ^
main.c:49:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define N 100
#define A 1
#define B 2
#define C 3

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

void DFS(void);
void DFSiku(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]=A;
  }
  time=0;
  for(i=0;i<n;i++){
    if(S[i]==A){
      DFSiku(i);
    }
  }
}

Compiler output:
/usr/bin/ld: /tmp/ccvCmFMB.o: in function `DFS':
main.c:(.text+0x226): undefined reference to `DFSiku'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 100;

int d[N], f[N], g[N][N] = {0};
int n;
int depth(int);
int time=1;

int main(){
	int i, j, a, b, c;
	
	scanf("%d", &n);
	
	for(i = 0; i < n; i++){
		scanf("%d%d", &a, &b);
		for(j = 0; j < b; j++){
			scanf("%d", &c);
			
			g[a-1][c-1] = 1;
		}
	}
	
	depth(0);
	
	i = 0;
	
	while(1){
		if(d[i] == 0){
			depth(i);
		}
		i++;
		
		if(i == n-1) break;
	}
	
	for(i = 0; i < n; i++){
		printf("%d %d %d\n", i+1, d[i], f[i]);
	}
	
	return 0;
}

int depth(int x){
	int i, j;
	d[x] = time;
	time++;
	for(i = 0; i < x; i++){
		if(g[x][i] == 1 && d[i] == 0){
			depth(i);
		}
	}
	
	f[x] = time;
	time++;
}

Compiler output:
main.c:2:14: error: expected ']' before ';' token
    2 | #define N 100;
      |              ^
main.c:4:7: note: in expansion of macro 'N'
    4 | int d[N], f[N], g[N][N] = {0};
      |       ^
main.c:4:14: error: expected identifier or '(' before ']' token
    4 | int d[N], f[N], g[N][N] = {0};
      |              ^
main.c:4:20: error: expected identifier or '(' before ']' token
    4 | int d[N], f[N], g[N][N] = {0};
      |                    ^
main.c:4:23: error: expected identifier or '(' before ']' token
    4 | int d[N], f[N], g[N][N] = {0};
      |                       ^
main.c: In function 'main':
main.c:19:25: error: 'g' undeclared (first use in this function)
   19 |                         g[a-1][c-1] = 1;
      |                         ^
main.c:19:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:20: error: 'd' undeclared (first use in this function)
   28 |                 if(d[i] == 0){
      |                    ^
main.c:37:49: error: 'f' undeclared (first use in this function)
   37 |                 printf("%d %d %d\n", i+1, d[i], f[i]);
      |                                                 ^
main.c: In function 'depth':
main.c:45:9: error: 'd' undeclared (first use in this function)
   45 |         d[x] = time;
      |         ^
main.c:48:20: error: 'g' undeclared (first use in this function)
   48 |                 if(g[x][i] == 1 && d[i] == 0){
      |                    ^
main.c:53:9: error: 'f' undeclared (first use in this function)
   53 |         f[x] = time;
      |         ^
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 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){
 
  int v;
 
  color[u] = GRAY;
  t++;
  d[u] = t;
 
  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;
  }
   
  t = 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:65:12: error: 'tt' undeclared (first use in this function); did you mean 't'?
   65 |   f[u] = ++tt;
      |            ^~
      |            t
main.c:65:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define max 100
 
int arr[max][max];
int d[max],f[max];
int count = 0,n;
 
void dfs(int i){
 
  int j;
  count++;
  d[i] = t;
 
  for(j = 0 ; j < n ; j++){
    if(arr[i][j] != 0 && d[j] == 0)dfs(j);
  }
 
  count++;
  f[i] = count;
}
 
 
int main(){
  int i,j;
  int 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);
      arr[u-1][v-1] =1;
    }
  }
 
  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 'dfs':
main.c:12:10: error: 't' undeclared (first use in this function)
   12 |   d[i] = t;
      |          ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int n;
int color[N], d[N], f[N], array[N][N];

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

void DFS(){
  int i, time;
  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;
}

Compiler output:
main.c: In function 'main':
main.c:29:3: error: implicit declaration of function 'DFS' [-Wimplicit-function-declaration]
   29 |   DFS();
      |   ^~~
main.c: At top level:
main.c:39:6: warning: conflicting types for 'DFS'; have 'void()'
   39 | void DFS(){
      |      ^~~
main.c:29:3: note: previous implicit declaration of 'DFS' with type 'void()'
   29 |   DFS();
      |   ^~~
main.c: In function 'DFS':
main.c:46:27: error: implicit declaration of function 'DFSvisit' [-Wimplicit-function-declaration]
   46 |     if(color[i] == WHITE) DFSvisit(i);
      |                           ^~~~~~~~
main.c: At top level:
main.c:50:6: warning: conflicting types for 'DFSvisit'; have 'void(int)'
   50 | void DFSvisit(int u){
      |      ^~~~~~~~
main.c:46:27: note: previous implicit declaration of 'DFSvisit' with type 'void(int)'
   46 |     if(color[i] == WHITE) DFSvisit(i);
      |                           ^~~~~~~~
main.c: In function 'DFSvisit':
main.c:53:12: error: 'time' undeclared (first use in this function)
   53 |   d[u] = ++time;
      |            ^~~~
main.c:2:1: note: 'time' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
    1 | #include<stdio.h>
  +++ |+#include <time.h>
    2 | #define N 105
main.c:53:12: note: each undeclared identifier is reported only once for each function it appears in
   53 |   d[u] = ++time;
      |            ^~~~
Language: C

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

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

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

void DFS(){
  int i, time;
  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] = ++t;

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

Compiler output:
main.c: In function 'main':
main.c:29:3: error: implicit declaration of function 'DFS' [-Wimplicit-function-declaration]
   29 |   DFS();
      |   ^~~
main.c: At top level:
main.c:39:6: warning: conflicting types for 'DFS'; have 'void()'
   39 | void DFS(){
      |      ^~~
main.c:29:3: note: previous implicit declaration of 'DFS' with type 'void()'
   29 |   DFS();
      |   ^~~
main.c: In function 'DFS':
main.c:46:27: error: implicit declaration of function 'DFSvisit' [-Wimplicit-function-declaration]
   46 |     if(color[i] == WHITE) DFSvisit(i);
      |                           ^~~~~~~~
main.c: At top level:
main.c:50:6: warning: conflicting types for 'DFSvisit'; have 'void(int)'
   50 | void DFSvisit(int u){
      |      ^~~~~~~~
main.c:46:27: note: previous implicit declaration of 'DFSvisit' with type 'void(int)'
   46 |     if(color[i] == WHITE) DFSvisit(i);
      |                           ^~~~~~~~
main.c: In function 'DFSvisit':
main.c:59:12: error: 'time' undeclared (first use in this function)
   59 |   f[u] = ++time;
      |            ^~~~
main.c:2:1: note: 'time' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
    1 | #include<stdio.h>
  +++ |+#include <time.h>
    2 | #define N 105
main.c:59:12: note: each undeclared identifier is reported only once for each function it appears in
   59 |   f[u] = ++time;
      |            ^~~~
Language: C

#include <stdio.h>
#include<stdlib.h>
 
#define N 101
 
void push(int x);
void pop(void);
int isEmpty(void);
int isFull(void);
void visit(int);
void dfs(int);
int next(int, int);
 
int d[N], f[N], A[N][N], t = 0, top = 0, n, S[N];
char color[N];
 
int main(){
  int i, j, k, l, m;
   
  scanf("%d",&n);
  for(i = 1; i <= n; i++){
    d[i] = 0;
    f[i] = 0;
    for(j = 1; j <= n; j++){
      A[i][j] = 0;
    }
  }
  for(i = 1; i <= n; i++){
    scanf("%d%d", &l, &m);
    for(j = 1; j <= m; j++){
      scanf("%d", &k);
      A[l][k] = 1; 
    }
  }
 
  dfs(n);
 
  for(i = 1; i <= n; i++){
    printf("%d %d %d\n", i, d[i], f[i]);
  }
 
  return 0;
}
 
void dfs(){

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

void visit(int u){

  int v;
  color[u] = GRAY;
  d[u]=++time;
  for(v=0;v<n;v++){
    if(S[u][v]==1 && color[v]==WHITE){
      visit(v);
    }
  }
  color[u] = BLACK;
  f[u] = ++time;
  
}
 
int next(int u, int n){
  int i;
 
  for(i = 1; i <= n; i++){
    if((A[u][i] == 1) && (d[i] == 0)) return i;
  }
 
  return -1;
 
}
 
void push(int x){
  if(isFull() == 0){
    fprintf(stderr, "overfullow");
    exit(8);
  }
  top++;
  S[top] = x;
}
 
void pop(void){
  if(isEmpty() == 0){
    fprintf(stderr, "underfullow");
    exit(8);
  }
  top--;
}
 
int isEmpty(void){
  if(top  == 0) return 0; 
  else return 1;
}
 
int isFull(void){
  if(top >= N -1) return 0; 
  else return 1;
}

Compiler output:
main.c: In function 'dfs':
main.c:45:1: error: number of arguments doesn't match prototype
   45 | void dfs(){
      | ^~~~
main.c:11:6: error: prototype declaration
   11 | void dfs(int);
      |      ^~~
main.c:49:16: error: 'WHITE' undeclared (first use in this function)
   49 |     color[i] = WHITE;
      |                ^~~~~
main.c:49:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:51:3: error: 'time' undeclared (first use in this function)
   51 |   time=0;
      |   ^~~~
main.c:3:1: note: 'time' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
    2 | #include<stdlib.h>
  +++ |+#include <time.h>
    3 | 
main.c: In function 'visit':
main.c:63:14: error: 'GRAY' undeclared (first use in this function)
   63 |   color[u] = GRAY;
      |              ^~~~
main.c:64:10: error: 'time' undeclared (first use in this function)
   64 |   d[u]=++time;
      |          ^~~~
main.c:64:10: note: 'time' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
main.c:66:12: error: subscripted value is neither array nor pointer nor vector
   66 |     if(S[u][v]==1 && color[v]==WHITE){
      |            ^
main.c:66:32: error: 'WHITE' undeclared (first use in this function)
   66 |     if(S[u][v]==1 && color[v]==WHITE){
      |                                ^~~~~
main.c:70:14: error: 'BLACK' undeclared (first use in this function)
   70 |   color[u] = BLACK;
      |              ^~~~~
Language: C

#include <stdio.h>

int connect[101][101]={0};
int d[101]={0};
int f[101]={0};
int used[101] = {0};
int n;
int cd = 1;

int dfs(int now)
{
  int i;

  if(used[now]) return???0;

  used[now] = 1;

  for(i = 0; i < n; i++){
    if(connect[now][i]){
      if(d[i] == 0){
	cd++;
	d[i] = cd;
      }
      dfs(i);
    }
  }
  used[now] = 0;
  if(f[now] == 0){
      cd++;
      f[now] = cd;
    }

  return 0;
}

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

  dfs(0);
  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 'dfs':
main.c:14:23: error: expected expression before '?' token
   14 |   if(used[now]) return???0;
      |                       ^
Language: C

#include <stdio.h>

int n,M[100][100],color[100],d[100],f[100],time;

void dfs_visit(int u){
  int v;
  color[u]=1;
  d[u]=++time;
  for(v=0;v<n;v++){
    if(M[u][v]==0){
      continue;
    }
    if(color[v]==0){
      dfs_visit(v);
    }
  }
  color[u]=2;
  f[u]=++time;
}
void dfs(){
  int u;
  for(u=0;u<n;u++){
    color[u]=0;
  }
  t=0;
  for(u=0;u<n;u++){
    if(color[u]==0){
      dfs_visit(u);
    }
  }
  for(u=0;u<n;u++){
    printf("%d %d %d\n",u+1,d[u],f[u]);
  }
}
int main(void)
{
  int i,j,k,u,v;
  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:25:3: error: 't' undeclared (first use in this function)
   25 |   t=0;
      |   ^
main.c:25:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int A[101][101];
int ans[101][3];
int an = 1;

int serch(int a[][], int  ni, int n){
  int  j;
  
  for(j=0; j<n; j++){
    if(A[ni][j] == 1){
      judge(j, 1);
      serch(A, j, n);
    }
  }
  judge(ni, 2);
}

int judge(int i, int j){
  ans[i][j] = an;
  an++;
}

int  main(){
  int i, j, k, n, x, y;
  
  scanf("%d", &n);
  
  for(i=0; i<n; i++){
    for(j=0; j<n; j++)
      A[i][j] = 0;
    ans[i][0] = i+1;
  }
  
  for(i=0; i<n; i++){
    scanf("%d %d", &x, &y);
    for(j=0; j<y; j++){
      scanf("%d", &k);
      A[i][k-1] = 1;
    }
  }
  
  judge(0, 1);
  
  for(i=0; i<n; i++){
    if(A[0][i] == 1){
      judge(i, 1);
      serch(A, i, n);
    }
  }
  judge(0, 2);
  
  for(i=0; i<n; i++){
    for(j=0; j<3; j++){
      if(j>0)
        printf(" ");
      printf("%d", ans[i][j]);
    }
    printf("\n");
  }
  
  return 0;
}

Compiler output:
main.c:7:15: error: array type has incomplete element type 'int[]'
    7 | int serch(int a[][], int  ni, int n){
      |               ^
main.c:7:15: note: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first
main.c: In function 'serch':
main.c:12:7: error: implicit declaration of function 'judge' [-Wimplicit-function-declaration]
   12 |       judge(j, 1);
      |       ^~~~~
main.c:13:13: error: type of formal parameter 1 is incomplete
   13 |       serch(A, j, n);
      |             ^
main.c: In function 'main':
main.c:48:13: error: type of formal parameter 1 is incomplete
   48 |       serch(A, i, n);
      |             ^
Language: C

#include<stdio.h>

int color[100],d[100],f[100],time,stack[100],point=0;
int a[100][100];
void push(int d) {
  stack[point]=d;
  if(color[d]==0){
    color[d]=1;
    d[d]=++time;
  }
  point++;
}
void pop(){
  point--;
}

void search(int n) {
  int i,u;
  u = 1;
  for(i=0;i<n;i++) color[i]=0;
  push(u);
  for(i=0;i<n;i++){
    a[u][i]
  
  

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

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

Compiler output:
main.c: In function 'push':
main.c:9:6: error: subscripted value is neither array nor pointer nor vector
    9 |     d[d]=++time;
      |      ^
main.c: In function 'search':
main.c:23:12: error: expected ';' before 'int'
   23 |     a[u][i]
      |            ^
      |            ;
......
   27 | int main() {
      | ~~~         
main.c:44:3: error: expected declaration or statement at end of input
   44 |   search();
      |   ^~~~~~
main.c:44:3: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
??
int color[101], n, d[101], f[101], v[101][101], time;
??
void visit(int u){
  int i;

  color[u] = 1;
  d[u] = ++time;
  for(i=1;i<=n;i++){


   if(color[i] == 0&&v[u][i]==1)visit(i);
   }
  color[u]=2;
  f[u] = ++time;
}
??
void dfs(){
  int i;

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

 int main(){


   int i,j,k[101],u[101],l;

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


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

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
main.c:4:1: error: expected identifier or '(' before '?' token
    4 | ??
      | ^
main.c:18:1: error: expected identifier or '(' before '?' token
   18 | ??
      | ^
main.c: In function 'main':
main.c:36:15: error: 'n' undeclared (first use in this function)
   36 |   scanf("%d",&n);
      |               ^
main.c:36:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:40:7: error: 'v' undeclared (first use in this function)
   40 |       v[i][j]=0;
      |       ^
main.c:51:4: error: implicit declaration of function 'dfs' [-Wimplicit-function-declaration]
   51 |    dfs();
      |    ^~~
main.c:55:32: error: 'd' undeclared (first use in this function)
   55 |       printf("%d %d %d\n",u[i],d[i],f[i]);
      |                                ^
main.c:55:37: error: 'f' undeclared (first use in this function)
   55 |       printf("%d %d %d\n",u[i],d[i],f[i]);
      |                                     ^
Language: C

#include<stdio.h>

int color[101], n, d[101], f[101], v[101][101], time;

 void visit(int u){
  int i;

  color[u] = 1;
  d[u] = ++time;
  for(i=1;i<=n;i++){


   if(color[i] == 0&&v[u][i]==1)visit(i);
   }
  color[u]=2;
  f[u] = ++time;
}

  void dfs(){
  int i;

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

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

 int main(){


   int i,j,k[101],u[101],l;

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


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

Compiler output:
main.c: In function 'dfs':
main.c:29:1: error: expected expression before '?' token
   29 | ????}
      | ^
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] = ++t;  // 最初の訪問
  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++ )
    // 未訪問の 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:14:12: error: 't' undeclared (first use in this function)
   14 |   d[u] = ++t;  // 最初の訪問
      |            ^
main.c:14:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define N 100
#define  GRAY 1
#define BLACK 2
using namespace std;
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] == 0)
    {
      dfs_visit(v);
    }
}
  color[u] = BLACK;
  f[u] == ++tt;
}
void dfs()
{
  int u;
  for(u = 0;u<n;u++)
     color[u] = 0;
  tt = 0;
  for(u = 0;u<n;u++)
  {
    if(color[u] == 0) 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: error: unknown type name 'using'
    5 | using namespace std;
      | ^~~~~
main.c:5:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    5 | using namespace std;
      |                 ^~~
Language: C

#16D8101014F KurumeRyunosuke 2018/6/20

n=int(input())
ls=[[0 for i in range(n)]for j in range(n)]
for i in range(n):
	tmp=input().split()
	for j in range(int(tmp[1])):
		ls[i][int(tmp[j+2])-1]=1

"""
for i in range(n):
    for j in range(n):
        if(j!=n-1):
            print(int(ls[i][j]), end=' ')
        else:
            print(int(ls[i][j]))
"""
stuck=[0]
count=1
d=[0 for i in range(n)]
f=[0 for i in range(n)]
d[0]=count
while True:
	count+=1
	p=0
	for i in range(n):
		if ls[stuck[len(stuck)-1]][i] is not 0:
			ls[stuck[len(stuck)-1]][i]=0
			
			p=1
			#print(stuck)
			stuck.append(i)
			d[stuck[len(stuck)-1]]=count
			break

	if p is 1:
		for i in range(n):
			ls[i][stuck[len(stuck)-1]]=0
	if p is 0:
		#print("//")
		a=stuck.pop()
		f[a]=count
		for i in range(n):
			ls[a][i]=0

	if len(stuck) is 0:
		t=0
		for i in range(n):
			for j in range(n):
				if ls[i][j] is not 0 and t is 0:
					count+=1
					stuck.append(i)
					d[stuck[len(stuck)-1]]=count
					#print(i)
					t=1
					
		if t is 0:
			break
		#print("break")

for i in range(n):
	print(i+1,d[i],f[i])



Compiler output:
main.c:1:2: error: "16D8101014F" after # is not a positive integer
    1 | #16D8101014F KurumeRyunosuke 2018/6/20
      |  ^~~~~~~~~~~
main.c:3:1: warning: data definition has no type or storage class
    3 | n=int(input())
      | ^
main.c:3:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:3:3: error: expected expression before 'int'
    3 | n=int(input())
      |   ^~~
main.c:10:3: warning: missing terminating " character
   10 | """
      |   ^
main.c:10:3: error: missing terminating " character
main.c:17:3: warning: missing terminating " character
   17 | """
      |   ^
main.c:17:3: error: missing terminating " character
main.c:31:26: error: invalid preprocessing directive #print
   31 |                         #print(stuck)
      |                          ^~~~~
main.c:40:18: error: invalid preprocessing directive #print
   40 |                 #print("//")
      |                  ^~~~~
main.c:54:42: error: invalid preprocessing directive #print
   54 |                                         #print(i)
      |                                          ^~~~~
main.c:59:18: error: invalid preprocessing directive #print
   59 |                 #print("break")
      |                  ^~~~~
Language: C

#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

#define MAXN 100
int n, timecount = 1;
int ans[MAXN][MAXN];
int d[MAXN], f[MAXN]; // d[i]はdを最初に発見した時刻,f[i]は調べ終わった時刻
bool is_reach[MAXN];

int dfs(int p);

int main(void) {
    cin >> n;
    for (int i = 0; i < n; i++) {
        d[i] = -1;
        f[i] = -1;
        is_reach[i] = false;
    }
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            ans[i][j] = 0;
    for (int i = 0; i < n; i++) {
        int u, k;
        cin >> u >> k;
        for (int j = 0; j < k; j++) {
            int tmp;
            cin >> tmp;
            ans[u-1][tmp-1] = 1;
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (j == n-1) cout << ans[i][j];
            else cout << ans[i][j] << " ";
        }
        cout << endl;
    }
    int start = 0;
    while (1) {
        dfs(start);
        int i;
        printf("%d search end\n", start);
        for (i = 0; i < n; i++) {
            if (f[i] == -1) {
                start = i;
                break;
            }
        }
        if (i == n) break;
        printf("next: %d\n", start);
    }
    for (int i = 0; i < n; i++) {
        printf("%d %d %d\n", i+1, d[i], f[i]);
    }
    return 0;
}

int dfs(int p)
{
    int ret = 0, count = 1;
    is_reach[p] = true;
    if (d[p] == -1) d[p] = timecount++;
    for (int i = 0; i < n; i++) {
        if (ans[p][i] == 1 && is_reach[i] == false && p != i) {
            dfs(i);
        }
    }
    if (f[p] == -1) f[p] = timecount;
    timecount++;
    return 0;
}

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

def dfs(n):
    global t
    S[n] = t
    DP[n]=1
    for i in A[n][2:]:
        if not DP[i]:
            t += 1
            dfs(i)
    t += 1
    F[n] = t
n = int(input())
A = [0]*(n+1)
S = [0]*(n+1)
F = [0]*(n+1)
DP = [0]*(n+1)
for i in range(n):
    A[i+1] = [int(i) for i in input().split()]
t = 0
for i in range(1,n+1):
    if not DP[i]:
        t+=1
        dfs(i)
for i in range(1,n+1):
    tmp = "{} {} {}".format(i,S[i],F[i])
    print(tmp)


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def dfs(n):
      | ^~~
Language: C++

#include <iostream>
using namespace std;

int n;
int M[100][100];
int color[100], d[100], f[100];
int time;

void Dfs(int u) {
  color[u] = 1;
  d[u] = ++time;
  for (int v = 0; v < n; v++) if (M[u][v] && color[v] == 0) Dfs(v);
  color[u] = 2;
  f[u] = ++time;
}

int main() {
  cin >> n;

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

  Dfs(0);

  for (int i = 0; i < n; i++) cout << i + 1 << " " << d[i] << " " << f[i] << endl;

  return 0;
}


Compiler output:
a.cc:7:5: error: 'int time' redeclared as different kind of entity
    7 | int time;
      |     ^~~~
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'void Dfs(int)':
a.cc:11:12: warning: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
   11 |   d[u] = ++time;
      |            ^~~~
a.cc:11:12: error: lvalue required as increment operand
a.cc:14:12: warning: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
   14 |   f[u] = ++time;
      |            ^~~~
a.cc:14:12: error: lvalue required as increment operand
Language: C++

#include <iostream>
using namespace std;

int n;
int M[100][100];
int color[100], d[100], f[100];
int time = 1;

void Dfs(int u) {
  color[u] = 1;
  d[u] = time;
  time++;
  for (int v = 0; v < n; v++) if (M[u][v] && color[v] == 0) Dfs(v);
  color[u] = 2;
  f[u] = time;
  time++;
}

int main() {
  cin >> n;

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

  Dfs(0);

  for (int i = 0; i < n; i++) cout << i + 1 << " " << d[i] << " " << f[i] << endl;

  return 0;
}


Compiler output:
a.cc:7:5: error: 'int time' redeclared as different kind of entity
    7 | int time = 1;
      |     ^~~~
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'void Dfs(int)':
a.cc:11:10: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   11 |   d[u] = time;
      |          ^~~~
      |          |
      |          time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:12:3: warning: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
   12 |   time++;
      |   ^~~~
a.cc:12:7: error: lvalue required as increment operand
   12 |   time++;
      |       ^~
a.cc:15:10: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   15 |   f[u] = time;
      |          ^~~~
      |          |
      |          time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:16:3: warning: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
   16 |   time++;
      |   ^~~~
a.cc:16:7: error: lvalue required as increment operand
   16 |   time++;
      |       ^~
Language: C++

#include <cstdio>
#include <cstring>
#include <stack>
#define N 110
using namespace std;
int n;
int m[N][N];
int used[N];
int time = 1;
int _start[N];
int _end[N];
int getnext(int u){
    for(int i = 1; i <= n; i++){
        if(m[u][i] == 1) return i;
    }
    return -1;
}
void dfs(int root){
    used[root] = 1;
    _start[root] = time++;
    stack<int> s;
    s.push(root);
    while(!s.empty()){
        int u = s.top();
        int v = getnext(u);
        if(v != -1 && used[v] == 0){
            used[v] = 1;
            _start[v] = time++;
            s.push(v);
        } else{
            _end[u] = time++;
            s.pop();
        }
    }
}
int main(){
    for(int i = 0; i < N; i++) for(int j = 0; j < N; j++) m[i][j] = 0;
    for(int i = 0; i < N; i++) used[i] = 0;
    scanf("%d", &n);
    for(int p = 0; p < n; p++){
        int node, k;
        scanf("%d %d", &node, &k);
        for(int i = 0; i < k; i++){
            int b;
            scanf("%d", &b);
            m[node][b] = 1;
        }
    }
    for(int i = 1; i <= n; i++) if(used[i] == 0) dfs(i);
    for(int i = 1; i <= n; i++){
        printf("%d %d %d\n", i, _start[i], _end[i]);
    }
    return 0;
}


Compiler output:
/usr/bin/ld: /tmp/ccHp1BkY.o:(.bss+0xbf00): multiple definition of `_start'; /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
Language: C++

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

vector<vector<int>> graph;
vector<int> d,f;
int tm =0;

void dfs(int v){
      if(d[v]!=0) return;
      tm++;
      d[v]=tm;

      for(int i=0;i<graph[v].size();i++){
            dfs(graph[v][i]);
      }
      tm++;
      f[v] = tm;
}

int main(){ 
      int n; cin>>n;
      graph.resize(n); d.assign(n,0); f.resize(n);
      for(int i=0;i<n;i++){
            int u,k; cin>>u>>k;
            if(k==0) continue;
            for(int j=0;j<k;j++){
                  int v; cin >> v;
                  graph[u].push_back(v-1);
            }
      }
      for(int i=0;i<n;i++){
            dfs(i);
      }
      for(int i=0;i<n;i++){
            cout << i+1 << " " << d[i] << f[i] << endl;
      }
      
}


Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:11:7: error: reference to 'tm' is ambiguous
   11 |       tm++;
      |       ^~
In file included from /usr/include/time.h:39,
                 from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
    7 | struct tm
      |        ^~
a.cc:7:5: note:                 'int tm'
    7 | int tm =0;
      |     ^~
a.cc:12:12: error: reference to 'tm' is ambiguous
   12 |       d[v]=tm;
      |            ^~
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
    7 | struct tm
      |        ^~
a.cc:7:5: note:                 'int tm'
    7 | int tm =0;
      |     ^~
a.cc:17:7: error: reference to 'tm' is ambiguous
   17 |       tm++;
      |       ^~
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
    7 | struct tm
      |        ^~
a.cc:7:5: note:                 'int tm'
    7 | int tm =0;
      |     ^~
a.cc:18:14: error: reference to 'tm' is ambiguous
   18 |       f[v] = tm;
      |              ^~
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
    7 | struct tm
      |        ^~
a.cc:7:5: note:                 'int tm'
    7 | int tm =0;
      |     ^~
Language: C++

#include <iostream>
using namespace std;

int a[100][100];
int n,p,q,r;
int T[100],F[100];
int Time = 0;
void dfs(int cur) {
	T[cur] = Time;
	Time += 1;
	for (int dst=0; dst < n; ++dst) {
		if(a[cur][dst] == 1 && T[dst] == -1) {
			dfs(dst);
		}
	}
	F[cur] = Time;
	Time += 1;
}

int main() {
	cin >> n;
	for (int i=0; i<n; ++i) {
		cin >> p >> q;
		T[i] = -1;
		for (int j=0; j<q; ++j) {
			cin >> r;
			a[p-1][r-1] = 1;
		}
	}
	dfs(0);
	for (int i=0; i<n-1; ++i) {
		cout << i+1 << " " << T[i]+1 << " " << F[i]+1 << endl;
}
cout << n << " " << T[n-1]+1 << " " << F[n-1]+1
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:48: error: expected ';' before '}' token
   34 | cout << n << " " << T[n-1]+1 << " " << F[n-1]+1
      |                                                ^
      |                                                ;
   35 | }
      | ~
Language: C++

#include <iostream>

using namespace std;

	int time = 0;
	int d[101];
	int f[101];
	int num;
	int graph[101][101] = {0};

void dfs(int x){
	time++;
	d[x] = time;

	for(int i=1;i<=num;i++){
		if(graph[x][i] == 1 && d[i]==0){
			printf("%d -> %d\n",x,i);
			dfs(i);
		}
	}
	f[x] = ++time;
}

int main(){
	int hon;
	int eda;
	int ver;

	cin>>num;
	for(int i=0;i<num;i++){
		cin>>eda;
		cin>>hon;
		for(int j=0;j<hon;j++){
			cin>>ver;
			graph[eda][ver]++;
		}
	}

	dfs(1);

	for(int i=1;i<=num;i++){
		cout<<i<<" "<<d[i]<<" "<<f[i]<<endl;
	}

	return 0;
}

Compiler output:
a.cc:5:13: error: 'int time' redeclared as different kind of entity
    5 |         int time = 0;
      |             ^~~~
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'void dfs(int)':
a.cc:12:9: warning: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
   12 |         time++;
      |         ^~~~
a.cc:12:13: error: lvalue required as increment operand
   12 |         time++;
      |             ^~
a.cc:13:16: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   13 |         d[x] = time;
      |                ^~~~
      |                |
      |                time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:21:18: warning: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
   21 |         f[x] = ++time;
      |                  ^~~~
a.cc:21:18: error: lvalue required as increment operand