Language: C++

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

using ll = long long;
using ld = long double;
using vi = vector<int>;

#define rep(i, a, b) for(auto i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define PB push_back

struct edge{int to;};
using graph = vector<vector<edge>>;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int n, m;
  cin >> n >> m;
  graph g(n);
  vi ideg(n);
  rep(i, 0, m) {
    int u, v;
    cin >> u >> v;
    --u; --v;
    g[u].PB({v});
    ideg[v]++;
  }
  vi dp(n);
  queue<int> q;
  rep(i, 0, n) if (ideg[i] == 0)
    q.push(i);
  auto relax = [&](int i) {
		 trav(e, g[i]) {
		   dp[e.to] = max(dp[e.to], dp[i] + 1);
		   if (--ideg[e.to] == 0)
		     q.push(e.to);
		 }
	       };
  while (!q.empty()) {
    int i = q.front();
    q.pop();
    relax(i);
  }
  cout << *max_element(all(dp)) << '\n';
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | >#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: expected unqualified-id before '>' token
    1 | >#include <bits/stdc++.h>
      | ^
a.cc:6:12: error: 'vector' does not name a type
    6 | using vi = vector<int>;
      |            ^~~~~~
a.cc:15:15: error: 'vector' does not name a type
   15 | using graph = vector<vector<edge>>;
      |               ^~~~~~
a.cc: In function 'int main()':
a.cc:18:3: error: 'ios_base' has not been declared
   18 |   ios_base::sync_with_stdio(false);
      |   ^~~~~~~~
a.cc:19:3: error: 'cin' was not declared in this scope
   19 |   cin.tie(nullptr);
      |   ^~~
a.cc:23:3: error: 'graph' was not declared in this scope
   23 |   graph g(n);
      |   ^~~~~
a.cc:24:3: error: 'vi' was not declared in this scope
   24 |   vi ideg(n);
      |   ^~
a.cc:29:5: error: 'g' was not declared in this scope
   29 |     g[u].PB({v});
      |     ^
a.cc:30:5: error: 'ideg' was not declared in this scope
   30 |     ideg[v]++;
      |     ^~~~
a.cc:32:5: error: expected ';' before 'dp'
   32 |   vi dp(n);
      |     ^~~
      |     ;
a.cc:33:3: error: 'queue' was not declared in this scope
   33 |   queue<int> q;
      |   ^~~~~
a.cc:33:9: error: expected primary-expression before 'int'
   33 |   queue<int> q;
      |         ^~~
a.cc:34:20: error: 'ideg' was not declared in this scope
   34 |   rep(i, 0, n) if (ideg[i] == 0)
      |                    ^~~~
a.cc:35:5: error: 'q' was not declared in this scope
   35 |     q.push(i);
      |     ^
a.cc: In lambda function:
a.cc:37:26: error: 'g' was not declared in this scope
   37 |                  trav(e, g[i]) {
      |                          ^
a.cc:9:34: note: in definition of macro 'trav'
    9 | #define trav(a, x) for(auto& a : x)
      |                                  ^
a.cc:38:20: error: 'dp' was not declared in this scope
   38 |                    dp[e.to] = max(dp[e.to], dp[i] + 1);
      |                    ^~
a.cc:38:31: error: 'max' was not declared in this scope
   38 |                    dp[e.to] = max(dp[e.to], dp[i] + 1);
      |                               ^~~
a.cc:39:26: error: 'ideg' was not declared in this scope
   39 |                    if (--ideg[e.to] == 0)
      |                          ^~~~
a.cc:40:22: error: 'q' was not declared in this scope
   40 |                      q.push(e.to);
      |                      ^
a.cc: In function 'int main()':
a.cc:43:11: error: 'q' was not declared in this scope
   43 |   while (!q.empty()) {
      |           ^
a.cc:48:3: error: 'cout' was not declared in this scope
   48 |   cout << *max_element(all(dp)) << '\n';
      |   ^~~~
a.cc:48:28: error: 'dp' was not declared in this scope
   48 |   cout << *max_element(all(dp)) << '\n';
      |                            ^~
a.cc:10:22: note: in definition of macro 'all'
   10 | #define all(x) begin(x), end(x)
      |                      ^
a.cc:10:16: error: 'begin' was not declared in this scope
   10 | #define all(x) begin(x), end(x)
      |                ^~~~~
a.cc:48:24: note: in expansion of macro 'all'
   48 |   cout << *max_element(all(dp)) << '\n';
      |                        ^~~
a.cc:10:26: error: 'end' was not declared in this scope
   10 | #define all(x) begin(x), end(x)
      |                          ^~~
a.cc:48:24: note: in expansion of macro 'all'
   48 |   cout << *max_element(all(dp)) << '\n';
      |                        ^~~
a.cc:48:12: error: 'max_element' was not declared in this scope
   48 |   cout << *max_element(all(dp)) << '\n';
      |            ^~~~~~~~~~~