Language: Java

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
#define REP(i,e) FOR(i,0,e)

#define all(o) (o).begin(), (o).end()
#define psb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))

typedef long long ll;
typedef pair<int, int> PII;

const double EPS = 1e-10;

typedef struct edge_def {
  int from;
  int to;
  int cost;

  edge_def(int _from, int _to, int _cost) {
    from = _from;
    to   = _to;
    cost = _cost;
  }
} edge;

const int V = 100;
int n, t;
vector<edge> es[V];
int d[V], f[V];

//??????????????????????????§time + 1
void dfs(int v) {
  int i;
  d[v] = ++t;
  for (i=0; i<(int)es[v].size(); i++) {
    int to = es[v][i].to;
    if (d[to] == -1) dfs(to);
  }
  f[v] = ++t;
}

int main() {
  int i, j;
  memset(d, 0xff, sizeof(d));
  memset(f, 0, sizeof(f));
  for (i=0; i<V; i++) es[i].clear();

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

  t = 0;
  for (i=0; i<n; i++) //??¨???????????£?????¨???????????????
    if (d[i] == -1) dfs(i);

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

	return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:5: error: illegal character: '#'
#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
^
Main.java:5: error: class, interface, enum, or record expected
#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
        ^
Main.java:5: error: class, interface, enum, or record expected
#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
                               ^
Main.java:5: error: class, interface, enum, or record expected
#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
                                            ^
Main.java:6: error: illegal character: '#'
#define REP(i,e) FOR(i,0,e)
^
Main.java:8: error: illegal character: '#'
#define all(o) (o).begin(), (o).end()
^
Main.java:9: error: illegal character: '#'
#define psb(x) push_back(x)
^
Main.java:10: error: illegal character: '#'
#define mp(x,y) make_pair((x),(y))
^
Main.java:13: error: class, interface, enum, or record expected
typedef pair<int, int> PII;
^
Main.java:15: error: class, interface, enum, or record expected
const double EPS = 1e-10;
^
Main.java:17: error: class, interface, enum, or record expected
typedef struct edge_def {
^
Main.java:19: error: unnamed classes are a preview feature and are disabled by default.
  int to;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:22: error: class, interface, enum, or record expected
  edge_def(int _from, int _to, int _cost) {
  ^
Main.java:24: error: class, interface, enum, or record expected
    to   = _to;
    ^
Main.java:25: error: class, interface, enum, or record expected
    cost = _cost;
    ^
Main.java:26: error: class, interface, enum, or record expected
  }
  ^
Main.java:29: error: class, interface, enum, or record expected
const int V = 100;
^
Main.java:30: error: class, interface, enum, or record expected
int n, t;
^
Main.java:31: error: class, interface, enum, or record expected
vector<edge> es[V];
^
Main.java:32: error: class, interface, enum, or record expected
int d[V], f[V];
^
Main.java:51: error: illegal start of expression
  scanf("%d ", &n);
               ^
Main.java:54: error: illegal start of expression
    scanf("%d ", &u);
                 ^
Main.java:55: error: illegal start of expression
    scanf("%d ", &k);
                 ^
Main.java:57: error: illegal start of expression
      scanf("%d ", &v);
                   ^
26 errors