Language: Java

/*
* @Author: dnhirapara
* @Date: 2020-04-30 22:24
* @Name: dp_g
*/
#include <bits/stdc++.h>\

using namespace std;

/************defination************/

#define endl "\n"
#define log(x) cerr << __LINE__ << ": " << #x << " -> " << (x) << endl;
#define ll long long int
#define ull unsigned long long int

void in_out_file(){
    #ifdef _DEBUG
        freopen("F:/Coding/CompetitiveProg/static/input.txt", "r", stdin);
        freopen("F:/Coding/CompetitiveProg/static/output.txt", "w", stdout);
        freopen("F:/Coding/CompetitiveProg/static/debug.txt", "w", stderr);
    #endif
}


//@time comp :
//@space comp :
int main(){
    // cin.ignore(); must be there when using getline(cin, s)
    #ifndef AUTO
        in_out_file();
    #endif
    ll n, m;
    cin>>n>>m;
    std::vector<ll> graph[n];
    ll vertax[n+1];
    for(ll i=0;i<=n;i++){
        vertax[i] = 0;
    }
    ll x, y;
    ll ans = 0;
    for(ll i=0;i<m;i++){
        cin>>x>>y;
        vertax[y] = max(vertax[x]+1,vertax[y]);
        if(ans < vertax[y]){
            ans = vertax[y];
        }
        // log(vertax[y])
    }
    cout<<ans<<endl;
    // for(ll i=0;i<n+1;i++){
    //     log(vertax[i])
    // }
    return 0;
}


Compiler output:
Main.java:6: error: illegal character: '#'
#include <bits/stdc++.h>\
^
Main.java:6: error: class, interface, enum, or record expected
#include <bits/stdc++.h>\
         ^
Main.java:6: error: illegal character: '\'
#include <bits/stdc++.h>\
                        ^
Main.java:12: error: illegal character: '#'
#define endl "\n"
^
Main.java:12: error: class, interface, enum, or record expected
#define endl "\n"
        ^
Main.java:13: error: illegal character: '#'
#define log(x) cerr << __LINE__ << ": " << #x << " -> " << (x) << endl;
^
Main.java:13: error: illegal character: '#'
#define log(x) cerr << __LINE__ << ": " << #x << " -> " << (x) << endl;
                                           ^
Main.java:14: error: illegal character: '#'
#define ll long long int
^
Main.java:14: error: class, interface, enum, or record expected
#define ll long long int
        ^
Main.java:15: error: illegal character: '#'
#define ull unsigned long long int
^
Main.java:18: error: illegal character: '#'
    #ifdef _DEBUG
    ^
Main.java:20: error: class, interface, enum, or record expected
        freopen("F:/Coding/CompetitiveProg/static/output.txt", "w", stdout);
        ^
Main.java:21: error: class, interface, enum, or record expected
        freopen("F:/Coding/CompetitiveProg/static/debug.txt", "w", stderr);
        ^
Main.java:22: error: illegal character: '#'
    #endif
    ^
Main.java:23: error: class, interface, enum, or record expected
}
^
Main.java:30: error: illegal character: '#'
    #ifndef AUTO
    ^
Main.java:32: error: illegal character: '#'
    #endif
    ^
Main.java:33: error: class, interface, enum, or record expected
    ll n, m;
    ^
Main.java:34: error: class, interface, enum, or record expected
    cin>>n>>m;
    ^
Main.java:35: error: class, interface, enum, or record expected
    std::vector<ll> graph[n];
    ^
Main.java:36: error: class, interface, enum, or record expected
    ll vertax[n+1];
    ^
Main.java:37: error: class, interface, enum, or record expected
    for(ll i=0;i<=n;i++){
    ^
Main.java:37: error: class, interface, enum, or record expected
    for(ll i=0;i<=n;i++){
               ^
Main.java:37: error: class, interface, enum, or record expected
    for(ll i=0;i<=n;i++){
                    ^
Main.java:39: error: class, interface, enum, or record expected
    }
    ^
Main.java:41: error: unnamed classes are a preview feature and are disabled by default.
    ll ans = 0;
    ^
  (use --enable-preview to enable unnamed classes)
Main.java:42: error: class, interface, enum, or record expected
    for(ll i=0;i<m;i++){
    ^
Main.java:42: error: class, interface, enum, or record expected
    for(ll i=0;i<m;i++){
               ^
Main.java:42: error: class, interface, enum, or record expected
    for(ll i=0;i<m;i++){
                   ^
Main.java:44: error: class, interface, enum, or record expected
        vertax[y] = max(vertax[x]+1,vertax[y]);
        ^
Main.java:45: error: class, interface, enum, or record expected
        if(ans < vertax[y]){
        ^
Main.java:47: error: class, interface, enum, or record expected
        }
        ^
Main.java:54: error: class, interface, enum, or record expected
    return 0;
    ^
Main.java:55: error: class, interface, enum, or record expected
}
^
34 errors