Language: C++

#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>
usinv namespace std;
int n,m,dp[202020],in[202020];
vector<int>v[202020];
queue<int>tpx;
int main()
{
	cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		int a,b;
		cin>>a>>b;
		a--;
		b--;
		v[a].push_back(b);
		in[b]++;
	}
	for(int i=0;i<n;i++)
	{
		if(!in[i])
		{
			tpx.push(i);
		}
	}
	while(tpx.size())
	{
        int i=tpx.front();
        tpx.pop();
        for(int j=0;j<v[i].size();j++)
		{
            dp[v[i][j]]=max(dp[i]+1,dp[v[i][j]]);
            in[v[i][j]]--;
            if(!in[v[i][j]])
			{
				tpx.push(v[i][j]);
			}
        }
    }
	int ans=0;
	for(int i=0;i<n;i++)
	{
		ans=max(ans,dp[i]);
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:19:1: error: 'usinv' does not name a type
   19 | usinv namespace std;
      | ^~~~~
a.cc:21:1: error: 'vector' does not name a type
   21 | vector<int>v[202020];
      | ^~~~~~
a.cc:22:1: error: 'queue' does not name a type
   22 | queue<int>tpx;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:25:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   25 |         cin>>n>>m;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:32:17: error: 'v' was not declared in this scope
   32 |                 v[a].push_back(b);
      |                 ^
a.cc:39:25: error: 'tpx' was not declared in this scope
   39 |                         tpx.push(i);
      |                         ^~~
a.cc:42:15: error: 'tpx' was not declared in this scope
   42 |         while(tpx.size())
      |               ^~~
a.cc:46:23: error: 'v' was not declared in this scope
   46 |         for(int j=0;j<v[i].size();j++)
      |                       ^
a.cc:48:25: error: 'max' was not declared in this scope; did you mean 'std::max'?
   48 |             dp[v[i][j]]=max(dp[i]+1,dp[v[i][j]]);
      |                         ^~~
      |                         std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:11:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:59:21: error: 'max' was not declared in this scope; did you mean 'std::max'?
   59 |                 ans=max(ans,dp[i]);
      |                     ^~~
      |                     std::max
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:61:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   61 |         cout<<ans<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:61:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   61 |         cout<<ans<<endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~