Language: C++

#include<bits/stdc++.h>

using namespace std;

/*void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void __print(vector<bool> x){cerr<<"{";int f=x.size();for(auto i:x){cerr<<i;(--f !=0)?cerr<<",":cerr<<"";}cerr<<"}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
//void __print(vector<bool> x) {int f = 0; cerr << '{'; for (auto i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
//void _print() {cerr << "]\n";}

#ifndef ONLINE_JUDGE
#define ANTHRO(x...) cerr << "[" << #x << "] = [", _print(x)
#else
#define ANTHRO(x...)
#endif

template<typename... T>
void read(T&... args) {
	((cin >> args), ...);
}

template<typename... T>
void writ(T&&... args) {
	((cout << args << " "), ...);
}*/
#define ll long long
#define MOD 1000000007
#define INF (ll)1e18
#define EPS 1e-9
/*
	XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    No, nothing good starts in a getaway car
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
*/
vector<vector<ll>> adj;
vector<bool> vis;
vector<ll> i_D;
void DFS(ll source,vector<ll> &dp){
	stack<ll> s;
	s.push(source);
	vis[source]=true;
	while(!s.empty()){
		ll temp=s.top();
		s.pop();
		for(auto i: adj[temp]){
			//ANTHRO(i,dp[temp]+1,dp[i]);
			dp[i]=max(dp[temp]+1,dp[i]);
			i_D[i]--;
			if(!vis[i]){
				s.push(i);
				vis[i]=true;
			}
		}
	}
	//ANTHRO(dp);
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,m; read(n,m);
    adj.resize(n);
    i_D.resize(n,0);
    for(ll i=0,x,y;i<m;i++){
		read(x,y);
		adj[--x].push_back(--y);
		i_D[y]++;
	}
	vector<ll> dp(n,0);
	vis.resize(n,false);
	for(ll i=0;i<n;i++){
		if(!vis[i] && !i_D[i]){
			DFS(i,dp);
		}
	}
	ll ma=0;
	for(auto i: dp){
		ma=max(ma,i);
	}
	writ(ma);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:20: error: invalid conversion from 'long long int' to 'void*' [-fpermissive]
   79 |     ll n,m; read(n,m);
      |                    ^
      |                    |
      |                    long long int
a.cc:79:17: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
   79 |     ll n,m; read(n,m);
      |             ~~~~^~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/include/c++/14/csignal:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:116,
                 from a.cc:1:
/usr/include/unistd.h:371:16: note: declared here
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
a.cc:83:24: error: invalid conversion from 'long long int' to 'void*' [-fpermissive]
   83 |                 read(x,y);
      |                        ^
      |                        |
      |                        long long int
a.cc:83:21: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
   83 |                 read(x,y);
      |                 ~~~~^~~~~
/usr/include/unistd.h:371:16: note: declared here
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
a.cc:98:9: error: 'writ' was not declared in this scope; did you mean 'write'?
   98 |         writ(ma);
      |         ^~~~
      |         write