Language: C

#include<stdio.h>
#define WHITE 1
#define BLACK 0
#define GLAY 3
#define N 102
int g[N][N],d[N],f[N],color[N],k[N];
int time,u,v,n;
  
void DFSVisit(int u){
  int i;
  color[u] = GLAY;
  d[u] = ++time;
  for(i = 0;i < k[u];i++){
    if(color[g[u][i]] ==  WHITE){
      DFSVisit(g[u][i]);
       }
       }
  color[u] = BLACK;
  f[u] = ++time;
}
  
void DFS(){
  int i;
  for(i = 1;i <=n; i++){
    color[i] = WHITE;
  }
    time = 0;
  for(i = 0; i < n;i++){
    if(color[i] == WHITE){
        DFSVisit(i);
    }
  }
  }
  
int main(){
  int i,j,l;
  scanf("%d",&n);
  
  for(i = 0;i < n; i++){
    scanf("%d",&u);
    scanf("%d",&l);
    k[u] = l;
    for(j = 0;j < k[u];j++){
      scanf("%d",&v);
      g[u][j] = v;
    }
  }
  
  
      DFS();
    for(i = 1; i <=n;i++){
      printf("%d %d %d\n", i,d[i],f[i]);
    }
    return 0;
  }

Compile Error Logs:
You are not authorized to see the message.

Status
Judge: 8/8	C	CPU: 00.00 sec	Memory: 636 KB	Length: 833 B	2015-07-09 13:35	2015-07-09 13:35
Results for testcases
Case #	Verdict	CPU Time	Memory	In	Out	Case Name
Case #1:	: Accepted	00.00 sec	608 KB	40 B	39 B	1.in
Case #2:	: Accepted	00.00 sec	600 KB	20 B	18 B	2.in
Case #3:	: Accepted	00.00 sec	608 KB	75 B	72 B	3.in
Case #4:	: Accepted	00.00 sec	600 KB	62 B	31 B	4.in
Case #5:	: Accepted	00.00 sec	612 KB	158 B	162 B	5.in
Case #6:	: Accepted	00.00 sec	612 KB	355 B	252 B	6.in
Case #7:	: Accepted	00.00 sec	636 KB	1552 B	984 B	7.in
Case #8:	: Accepted	00.00 sec	616 KB	535 B	342 B	8.in

< prev |	1	/	8	| next >	 		 : Accepted        00.00 sec        608 KB
 
Judge Input #1 ( in1.txt | 40 B)		Judge Output #1 ( out1.txt | 39 B)
6
1 2 2 4
2 1 5
3 2 5 6
4 0
5 1 4
6 1 6
1 1 8
2 2 7
3 9 12
4 4 5
5 3 6
6 10 11
Comments
 
 Under Construction.
 
Categories
 
 
Free Tags
 
 

Compiler output:
main.c:57:1: error: unknown type name 'Compile'
   57 | Compile Error Logs:
      | ^~~~~~~
main.c:57:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Logs'
   57 | Compile Error Logs:
      |               ^~~~
main.c:61:81: error: invalid digit "9" in octal constant
   61 | Judge: 8/8      C       CPU: 00.00 sec  Memory: 636 KB  Length: 833 B   2015-07-09 13:35        2015-07-09 13:35
      |                                                                                 ^~
main.c:61:105: error: invalid digit "9" in octal constant
   61 | Judge: 8/8      C       CPU: 00.00 sec  Memory: 636 KB  Length: 833 B   2015-07-09 13:35        2015-07-09 13:35
      |                                                                                                         ^~
main.c:63:6: error: stray '#' in program
   63 | Case #  Verdict CPU Time        Memory  In      Out     Case Name
      |      ^
main.c:64:6: error: stray '#' in program
   64 | Case #1:        : Accepted      00.00 sec       608 KB  40 B    39 B    1.in
      |      ^
main.c:64:73: error: invalid suffix "in" on floating constant
   64 | Case #1:        : Accepted      00.00 sec       608 KB  40 B    39 B    1.in
      |                                                                         ^~~~
main.c:65:6: error: stray '#' in program
   65 | Case #2:        : Accepted      00.00 sec       600 KB  20 B    18 B    2.in
      |      ^
main.c:65:73: error: invalid suffix "in" on floating constant
   65 | Case #2:        : Accepted      00.00 sec       600 KB  20 B    18 B    2.in
      |                                                                         ^~~~
main.c:66:6: error: stray '#' in program
   66 | Case #3:        : Accepted      00.00 sec       608 KB  75 B    72 B    3.in
      |      ^
main.c:66:73: error: invalid suffix "in" on floating constant
   66 | Case #3:        : Accepted      00.00 sec       608 KB  75 B    72 B    3.in
      |                                                                         ^~~~
main.c:67:6: error: stray '#' in program
   67 | Case #4:        : Accepted      00.00 sec       600 KB  62 B    31 B    4.in
      |      ^
main.c:67:73: error: invalid suffix "in" on floating constant
   67 | Case #4:        : Accepted      00.00 sec       600 KB  62 B    31 B    4.in
      |                                                                         ^~~~
main.c:68:6: error: stray '#' in program
   68 | Case #5:        : Accepted      00.00 sec       612 KB  158 B   162 B   5.in
      |      ^
main.c:68:73: error: invalid suffix "in" on floating constant
   68 | Case #5:        : Accepted      00.00 sec       612 KB  158 B   162 B   5.in
      |                                                                         ^~~~
main.c:69:6: error: stray '#' in program
   69 | Case #6:        : Accepted      00.00 sec       612 KB  355 B   252 B   6.in
      |      ^
main.c:69:73: error: invalid suffix "in" on floating constant
   69 | Case #6:        : Accepted      00.00 sec       612 KB  355 B   252 B   6.in
      |                                                                         ^~~~
main.c:70:6: error: stray '#' in program
   70 | Case #7:        : Accepted      00.00 sec       636 KB  1552 B  984 B   7.in
      |      ^
main.c:70:73: error: invalid suffix "in" on floating constant
   70 | Case #7:        : Accepted      00.00 sec       636 KB  1552 B  984 B   7.in
      |                                                                         ^~~~
main.c:71:6: error: stray '#' in program
   71 | Case #8:        : Accepted      00.00 sec       616 KB  535 B   342 B   8.in
      |      ^
main.c:71:73: error: invalid suffix "in" on floating constant
   71 | Case #8:        : Accepted      00.00 sec       616 KB  535 B   342 B   8.in
      |                                                                         ^~~~
main.c:75:13: error: stray '#' in program
   75 | Judge Input #1 ( in1.txt | 40 B)                Judge Output #1 ( out1.txt | 39 B)
      |             ^
main.c:75:62: error: stray '#' in program
   75 | Judge Input #1 ( in1.txt | 40 B)                Judge Output #1 ( out1.txt | 39 B)
      |                                                              ^