Language: C++

#include <iostream>
#include <vector>
using namespace std;
//
bool negative=true;
struct edge{int from;int to;int cost;};
struct bellman{
	//
	int v,e;
	vector<edge> G;
	vector<ll> D;
	//
	bellman(int n,int m){
		v=n;e=m;
		D.resize(v);
	}
	//
	void add_edge(int from,int to,int cost){
		G.push_back((edge){from,to,cost});
	}
	//
	vector<ll> dist(int s){
		fill(D.begin(),D.end(),1e18+7);
		D[s]=0LL;
		for(int i=0;i<v;i++){
			bool f=false;
			for(int j=0;j<e;j++){
				edge &e=G[j];
				if(D[e.from]!=1e18+7&&D[e.to]>D[e.from]+e.cost){
					D[e.to]=D[e.from]+e.cost;
					f=true;
					if(i==v-1){
						negative=false;
						break;
					}
				}
			}
			if(!negative){
				break;
			}
			if(!f){
				break;
			}
		}
		return D;
	}
	//
};
//
int main(){
	int V,E;
	cin>>V>>E;
	bellman be(V,E);
	for(int i=0;i<E;i++){
		int s,t,d;
		cin>>s>>t>>d;
		be.add_edge(s,t,d);
	}
	vector<ll> ans=be.dist(0);
	if(!negative){
		cout<<"NEGATIVE CYCLE"<<endl;
		return 0;
	}
	for(int i=0;i<V;i++){
		vector<ll> ans=be.dist(i);
		for(int j=0;j<V;j++){
			if(j!=0){
				cout<<" ";
			}
			if(ans[j]==1e18+7){
				cout<<"INF";
			}else{
				cout<<ans[j];
			}
		}
		cout<<endl;
	}
	return 0;
}


Compiler output:
a.cc:11:16: error: 'll' was not declared in this scope
   11 |         vector<ll> D;
      |                ^~
a.cc:11:18: error: template argument 1 is invalid
   11 |         vector<ll> D;
      |                  ^
a.cc:11:18: error: template argument 2 is invalid
a.cc:22:16: error: 'll' was not declared in this scope
   22 |         vector<ll> dist(int s){
      |                ^~
a.cc:22:18: error: template argument 1 is invalid
   22 |         vector<ll> dist(int s){
      |                  ^
a.cc:22:18: error: template argument 2 is invalid
a.cc: In constructor 'bellman::bellman(int, int)':
a.cc:15:19: error: request for member 'resize' in '((bellman*)this)->bellman::D', which is of non-class type 'int'
   15 |                 D.resize(v);
      |                   ^~~~~~
a.cc: In member function 'int bellman::dist(int)':
a.cc:23:24: error: request for member 'begin' in '((bellman*)this)->bellman::D', which is of non-class type 'int'
   23 |                 fill(D.begin(),D.end(),1e18+7);
      |                        ^~~~~
a.cc:23:34: error: request for member 'end' in '((bellman*)this)->bellman::D', which is of non-class type 'int'
   23 |                 fill(D.begin(),D.end(),1e18+7);
      |                                  ^~~
a.cc:24:18: error: invalid types 'int[int]' for array subscript
   24 |                 D[s]=0LL;
      |                  ^
a.cc:29:37: error: invalid types 'int[int]' for array subscript
   29 |                                 if(D[e.from]!=1e18+7&&D[e.to]>D[e.from]+e.cost){
      |                                     ^
a.cc:29:56: error: invalid types 'int[int]' for array subscript
   29 |                                 if(D[e.from]!=1e18+7&&D[e.to]>D[e.from]+e.cost){
      |                                                        ^
a.cc:29:64: error: invalid types 'int[int]' for array subscript
   29 |                                 if(D[e.from]!=1e18+7&&D[e.to]>D[e.from]+e.cost){
      |                                                                ^
a.cc:30:42: error: invalid types 'int[int]' for array subscript
   30 |                                         D[e.to]=D[e.from]+e.cost;
      |                                          ^
a.cc:30:50: error: invalid types 'int[int]' for array subscript
   30 |                                         D[e.to]=D[e.from]+e.cost;
      |                                                  ^
a.cc: In function 'int main()':
a.cc:59:16: error: 'll' was not declared in this scope
   59 |         vector<ll> ans=be.dist(0);
      |                ^~
a.cc:59:18: error: template argument 1 is invalid
   59 |         vector<ll> ans=be.dist(0);
      |                  ^
a.cc:59:18: error: template argument 2 is invalid
a.cc:65:26: error: template argument 2 is invalid
   65 |                 vector<ll> ans=be.dist(i);
      |                          ^
a.cc:70:31: error: invalid types 'int[int]' for array subscript
   70 |                         if(ans[j]==1e18+7){
      |                               ^
a.cc:73:42: error: invalid types 'int[int]' for array subscript
   73 |                                 cout<<ans[j];
      |                                          ^