Language: C++

#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define ll __int64
//#define ll long long
#define P pair<ll,ll>

vector<P>G[1100];
int n,m;
ll a,b,c;
ll dist[1100];
const ll INF=-20000000000000000;

int main(){
	//O(VE)辺に着目して距離を更新
	cin>>n>>m;
	rep(i,n)dist[i]=INF;

	rep(i,m){
		cin>>a>>b>>c;
		a--;
		b--;
		G[a].push_back(mp(b,c));
		//G[b].push_back(mp(a,c));
	}	
	dist[0]=0;

	rep(i,n+1){
		bool update=false;
			rep(j,n){
			rep(k,G[j].size()){
				int from=j,to=G[j][k].first,cost=G[j][k].second;
				if(dist[to]<dist[from]+cost){
					update=true;
					dist[to]=dist[from]+cost;
				}
			}
			}
		if(!update)break;
		if(i==n){
			cout<<"inf\n";
			return 0;
		}
	}

	cout<<dist[n-1]<<endl;
	return 0;
}

Compiler output:
a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:18:16: note: in expansion of macro 'll'
   18 | #define P pair<ll,ll>
      |                ^~
a.cc:20:8: note: in expansion of macro 'P'
   20 | vector<P>G[1100];
      |        ^
a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:18:19: note: in expansion of macro 'll'
   18 | #define P pair<ll,ll>
      |                   ^~
a.cc:20:8: note: in expansion of macro 'P'
   20 | vector<P>G[1100];
      |        ^
a.cc:18:21: error: template argument 1 is invalid
   18 | #define P pair<ll,ll>
      |                     ^
a.cc:20:8: note: in expansion of macro 'P'
   20 | vector<P>G[1100];
      |        ^
a.cc:18:21: error: template argument 2 is invalid
   18 | #define P pair<ll,ll>
      |                     ^
a.cc:20:8: note: in expansion of macro 'P'
   20 | vector<P>G[1100];
      |        ^
a.cc:20:9: error: template argument 1 is invalid
   20 | vector<P>G[1100];
      |         ^
a.cc:20:9: error: template argument 2 is invalid
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:22:1: note: in expansion of macro 'll'
   22 | ll a,b,c;
      | ^~
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:23:1: note: in expansion of macro 'll'
   23 | ll dist[1100];
      | ^~
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:24:7: note: in expansion of macro 'll'
   24 | const ll INF=-20000000000000000;
      |       ^~
a.cc: In function 'int main()':
a.cc:29:17: error: 'dist' was not declared in this scope
   29 |         rep(i,n)dist[i]=INF;
      |                 ^~~~
a.cc:29:25: error: 'INF' was not declared in this scope
   29 |         rep(i,n)dist[i]=INF;
      |                         ^~~
a.cc:32:22: error: 'a' was not declared in this scope
   32 |                 cin>>a>>b>>c;
      |                      ^
a.cc:32:25: error: 'b' was not declared in this scope
   32 |                 cin>>a>>b>>c;
      |                         ^
a.cc:32:28: error: 'c' was not declared in this scope
   32 |                 cin>>a>>b>>c;
      |                            ^
a.cc:38:9: error: 'dist' was not declared in this scope
   38 |         dist[0]=0;
      |         ^~~~
a.cc:43:36: error: request for member 'size' in 'G[j]', which is of non-class type 'int'
   43 |                         rep(k,G[j].size()){
      |                                    ^~~~
a.cc:13:32: note: in definition of macro 'rep'
   13 | #define rep(i,a) for(int i=0;i<a;i++)
      |                                ^
a.cc:44:51: error: invalid types 'int[int]' for array subscript
   44 |                                 int from=j,to=G[j][k].first,cost=G[j][k].second;
      |                                                   ^
a.cc:45:56: error: 'cost' was not declared in this scope; did you mean 'const'?
   45 |                                 if(dist[to]<dist[from]+cost){
      |                                                        ^~~~
      |                                                        const