Language: C++

#include <iostream> 
#include <string> 
#include <vector> 
#include <cmath> 
#include <algorithm> 
#include <cstdlib> 
#include <ctime> 
#include <cstdio> 
#include <functional> 
#include <set> 
#include <sstream> 
#include <cctype>
#include <stack>
#include <queue>
#include <cstring>
#include <map>
#include <list>
#include <cassert>
 
using namespace std; 
 
struct edge{
	int from,to;
	int128_t cost;
	edge(int from_,int to_,int128_t cost_){
		from=from_;
		to=to_;
		cost=cost_;
	}
};
 
int n,m;
vector<edge> e;
vector<int128_t> d;
const int128_t INF=1e18;
bool bf(int s){
 
	for(int i=0;i<n;i++) d[i]=INF;
	d[s]=0;
 
	int cnt=0;
	while(true){
		bool update=false;
 
		for(int i=0;i<m;i++){
			edge ed=e[i];
			if(d[ed.from]!=INF && d[ed.to]>d[ed.from]+ed.cost){
				d[ed.to]=d[ed.from]+ed.cost;
				update=true;
			}
		}
 
		if(!update) break;
		if(cnt==n+1) return false;
		cnt++;
	}
 
	return true;
 
}
 
int main(){
 
	cin>>n>>m;
 
	d=vector<long long>(n);
	for(int i=0;i<m;i++){
		int a,b;
		int128_t c;
		cin>>a>>b>>c;
		e.push_back(edge(a-1,b-1,-c));
	}
 
	if(bf(0)) cout<<-d[n-1]<<endl;
	else cout<<"inf"<<endl;
 
 
	return 0;
}

Compiler output:
a.cc:24:9: error: 'int128_t' does not name a type; did you mean 'int8_t'?
   24 |         int128_t cost;
      |         ^~~~~~~~
      |         int8_t
a.cc:25:32: error: 'int128_t' has not been declared
   25 |         edge(int from_,int to_,int128_t cost_){
      |                                ^~~~~~~~
a.cc: In constructor 'edge::edge(int, int, int)':
a.cc:28:17: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   28 |                 cost=cost_;
      |                 ^~~~
      |                 cosl
a.cc: At global scope:
a.cc:34:8: error: 'int128_t' was not declared in this scope; did you mean 'int8_t'?
   34 | vector<int128_t> d;
      |        ^~~~~~~~
      |        int8_t
a.cc:34:16: error: template argument 1 is invalid
   34 | vector<int128_t> d;
      |                ^
a.cc:34:16: error: template argument 2 is invalid
a.cc:35:7: error: 'int128_t' does not name a type; did you mean 'int8_t'?
   35 | const int128_t INF=1e18;
      |       ^~~~~~~~
      |       int8_t
a.cc: In function 'bool bf(int)':
a.cc:38:31: error: invalid types 'int[int]' for array subscript
   38 |         for(int i=0;i<n;i++) d[i]=INF;
      |                               ^
a.cc:38:35: error: 'INF' was not declared in this scope
   38 |         for(int i=0;i<n;i++) d[i]=INF;
      |                                   ^~~
a.cc:39:10: error: invalid types 'int[int]' for array subscript
   39 |         d[s]=0;
      |          ^
a.cc:47:29: error: invalid types 'int[int]' for array subscript
   47 |                         if(d[ed.from]!=INF && d[ed.to]>d[ed.from]+ed.cost){
      |                             ^
a.cc:47:40: error: 'INF' was not declared in this scope
   47 |                         if(d[ed.from]!=INF && d[ed.to]>d[ed.from]+ed.cost){
      |                                        ^~~
a.cc:47:48: error: invalid types 'int[int]' for array subscript
   47 |                         if(d[ed.from]!=INF && d[ed.to]>d[ed.from]+ed.cost){
      |                                                ^
a.cc:47:57: error: invalid types 'int[int]' for array subscript
   47 |                         if(d[ed.from]!=INF && d[ed.to]>d[ed.from]+ed.cost){
      |                                                         ^
a.cc:47:70: error: 'struct edge' has no member named 'cost'
   47 |                         if(d[ed.from]!=INF && d[ed.to]>d[ed.from]+ed.cost){
      |                                                                      ^~~~
a.cc:48:34: error: invalid types 'int[int]' for array subscript
   48 |                                 d[ed.to]=d[ed.from]+ed.cost;
      |                                  ^
a.cc:48:43: error: invalid types 'int[int]' for array subscript
   48 |                                 d[ed.to]=d[ed.from]+ed.cost;
      |                                           ^
a.cc:48:56: error: 'struct edge' has no member named 'cost'
   48 |                                 d[ed.to]=d[ed.from]+ed.cost;
      |                                                        ^~~~
a.cc: In function 'int main()':
a.cc:66:11: error: cannot convert 'std::vector<long long int>' to 'int' in assignment
   66 |         d=vector<long long>(n);
      |           ^~~~~~~~~~~~~~~~~~~~
      |           |
      |           std::vector<long long int>
a.cc:69:17: error: 'int128_t' was not declared in this scope; did you mean 'int8_t'?
   69 |                 int128_t c;
      |                 ^~~~~~~~
      |                 int8_t
a.cc:70:28: error: 'c' was not declared in this scope
   70 |                 cin>>a>>b>>c;
      |                            ^
a.cc:74:27: error: invalid types 'int[int]' for array subscript
   74 |         if(bf(0)) cout<<-d[n-1]<<endl;
      |                           ^