criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define INF (int)1e9;
using namespace std;

typedef int Weight;
struct Edge {
  int src, dst;
  Weight weight;
  Edge(int src, int dst, Weight weight) :
    src(src), dst(dst), weight(weight) { }
};
bool operator < (const Edge &e, const Edge &f) {
  return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
    e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<Weight> Array;
typedef vector<Array> Matrix;

bool shortestPath(const Graph g, int s,
    vector<Weight> &dist, vector<int> &prev) {
  int n = g.size();
  dist.assign(n, INF+INF); dist[s] = 0;
  prev.assign(n, -2);
  bool negative_cycle = false;
  REP(k, n) REP(i, n) FOR(e,g[i]) {
    if (dist[e->dst] > dist[e->src] + e->weight) {
      dist[e->dst] = dist[e->src] + e->weight;
      prev[e->dst] = e->src;
      if (k == n-1) {
        dist[e->dst] = -INF;
        negative_cycle = true;
      }
    }
  }
  return !negative_cycle;
}

int main(){
	int r,T,V,E,s,t,e,i;
	//for(scanf("%d",&T);T;putchar(--T?' ':'\n')){
		scanf("%d%d%d",&V,&E,&r);
		Graph g(V);
		vector<Weight> dist;
		vector<int> prev;
		for(;E--;)scanf("%d%d%d",&s,&t,&e),g[s].push_back(Edge(s,t,e));
		if(!shortestPath(g,r,dist,prev))puts("NEGATIVE CYCLE");
		else for(i=0;i<V;i++){
			if(dist[i]>=INF)puts("INF");
			else printf("%d\n",dist[i]);
		}
	//}
}

Compiler output:
a.cc: In function 'bool shortestPath(Graph, int, std::vector<int>&, std::vector<int>&)':
a.cc:8:21: error: expected ')' before ';' token
    8 | #define INF (int)1e9;
      |                     ^
a.cc:30:18: note: in expansion of macro 'INF'
   30 |   dist.assign(n, INF+INF); dist[s] = 0;
      |                  ^~~
a.cc:30:14: note: to match this '('
   30 |   dist.assign(n, INF+INF); dist[s] = 0;
      |              ^
a.cc:30:25: error: expected primary-expression before ')' token
   30 |   dist.assign(n, INF+INF); dist[s] = 0;
      |                         ^
a.cc: In function 'int main()':
a.cc:56:40: error: expected primary-expression before ')' token
   56 |                         if(dist[i]>=INF)puts("INF");
      |                                        ^
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define INF (int)1e9;
using namespace std;

typedef int Weight;
struct Edge {
  int src, dst;
  Weight weight;
  Edge(int src, int dst, Weight weight) :
    src(src), dst(dst), weight(weight) { }
};
bool operator < (const Edge &e, const Edge &f) {
  return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
    e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<Weight> Array;
typedef vector<Array> Matrix;

bool shortestPath(const Graph g, int s,
    vector<Weight> &dist, vector<int> &prev) {
  int n = g.size();
  dist.assign(n, INF+INF); dist[s] = 0;
  prev.assign(n, -2);
  bool negative_cycle = false;
  REP(k, n) REP(i, n) if(dist[i]<INF) FOR(e,g[i]) {
    if (dist[e->dst] > dist[e->src] + e->weight) {
      dist[e->dst] = dist[e->src] + e->weight;
      prev[e->dst] = e->src;
      if (k == n-1) {
        dist[e->dst] = -INF;
        negative_cycle = true;
      }
    }
  }
  return !negative_cycle;
}

int main(){
	int r,T,V,E,s,t,e,i;
	//for(scanf("%d",&T);T;putchar(--T?' ':'\n')){
		scanf("%d%d%d",&V,&E,&r);
		Graph g(V);
		vector<Weight> dist;
		vector<int> prev;
		for(;E--;)scanf("%d%d%d",&s,&t,&e),g[s].push_back(Edge(s,t,e));
		if(!shortestPath(g,r,dist,prev))puts("NEGATIVE CYCLE");
		else for(i=0;i<V;i++){
			if(dist[i]>=INF)puts("INF");
			else printf("%d\n",dist[i]);
		}
	//}
}

Compiler output:
a.cc: In function 'bool shortestPath(Graph, int, std::vector<int>&, std::vector<int>&)':
a.cc:8:21: error: expected ')' before ';' token
    8 | #define INF (int)1e9;
      |                     ^
a.cc:30:18: note: in expansion of macro 'INF'
   30 |   dist.assign(n, INF+INF); dist[s] = 0;
      |                  ^~~
a.cc:30:14: note: to match this '('
   30 |   dist.assign(n, INF+INF); dist[s] = 0;
      |              ^
a.cc:30:25: error: expected primary-expression before ')' token
   30 |   dist.assign(n, INF+INF); dist[s] = 0;
      |                         ^
a.cc:33:37: error: expected primary-expression before ')' token
   33 |   REP(k, n) REP(i, n) if(dist[i]<INF) FOR(e,g[i]) {
      |                                     ^
a.cc: In function 'int main()':
a.cc:56:40: error: expected primary-expression before ')' token
   56 |                         if(dist[i]>=INF)puts("INF");
      |                                        ^
Language: C

#include <stdio.h>
#define INF 1e12
#define min(a, b) ((a < b) ? a : b)

typedef long long int LL;
 
int main()
{
    int i, j, k;
    int v, e;
    int s, t, d;
    LL G[101][101];
 
    scanf("%d %d", &v, &e);
 
    for (i = 0; i < v; i ++) {
        for (j = 0; j < v; j++) {
            G[i][j] = (i == j) ? 0 : INF;
        }
    }
 
    for (i = 0; i < e; i++) {
        scanf("%d %d %d", &s, &t, &d);
        G[s][t] = d;
    }
 
    for (k = 0; k < n; k++) {
        for (i = 0; i < n; i++) {
            for (j = 0; j < n; j++) {
                if (G[i][k] != INF && G[k][j] != INF) {
                    G[i][j] = min(G[i][j], G[i][k] + G[k][j]);
                }
            }
        }
    }
 
    for (i = 0; i < v; i++) {
        if (G[i][i] < 0) {
            printf("NEGATIVE CYCLE\n");
            return 0;
        }
    }
 
    for (i = 0; i < v; i++) {
        for (j = 0; j < v; j++) {
            printf(G[i][j] == INF ? "INF" : "%lld", G[i][j]);
            printf((j == v-1) ? "\n" : " ");
        }
    }
 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:21: error: 'n' undeclared (first use in this function)
   27 |     for (k = 0; k < n; k++) {
      |                     ^
main.c:27:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
#include<string>
#include<cstring>
using namespace std;
const int inf=2e9+5;
const int maxn=100;
typedef vector<int> vi;
typedef long long ll;
#define fi first
#define se second
typedef pair<int,int> P;
int d[maxn+5][maxn+5];
int v,e;

void floyd()
{
  for(int k=0;k<v;k++)
  {
    for(int i=0;i<v;i++)
    {
      for(int j=0;j<v;j++)
      {
        if(d[i][k]==inf || d[k][j]==inf) continue;
        d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
      }
    }
  }
}

int main(void)
{
  cin >> v >> e;
  for(int i=0;i<maxn+5;i++)
  {
    for(int j=0;j<maxn+5;j++)
    {
      if(i==j) d[i][j]=0;
      else d[i][j]=inf;
    }
  }
  for(int i=0;i<e;i++)
  {
    int s,t,cost;
    cin >> s >> t >> cost;
    d[s][t]=cost;
  }
  floyd();
  bool nega=false;
  for(int i=0;i<v;i++)
  {
    if(d[i][i]<0)
    {
      nega=true;
    }
  }
  if(nega)
  {
    cout << "NEGATIVE CYCLE" << endl;
  }
  else
  {
    for(int i=0;i<v;i++)
    {
      for(int j=0;j<v;j++)
      {
        if(d[i][j]==inf) cout << "INF";
        else cout << d[i][j];
        if(j!=v-1) cout << ' ';
      }
      cout << endl;
    }
  }



Compiler output:
a.cc: In function 'int main()':
a.cc:75:4: error: expected '}' at end of input
   75 |   }
      |    ^
a.cc:34:1: note: to match this '{'
   34 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    long long n, e; cin >> n >> e;
    vector<vector<long long> > g(n + 1, vector<long long> (n + 1, 1000000000000));
    for(long long i = 0; i < n; i++) g[i][i] = 0;
    for(long long i = 0; i < e; i++){
        long long a, b, d; cin >> a >> b >> d;
        g[a][b] = min(g[a][b], d);
    }

    //ワーシャルフロイド
    for(long long k = 0; k < n; k++){
        for(long long i = 0; i < n; i++){
            for(long long j = 0; j < n; j++){
                if(g[i][k] != 1000000000000 && g[k][j] != 1000000000000) g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
                if(i == j && g[i][j] < 0) return !prlong longf("NEGATIVE CYCLE\n");
            }
        }
    }

    for(long long i = 0; i < n; i++){
        for(long long j = 0; j < n; j++){
            if(g[i][j] == 1000000000) cout << "INF";
            else cout << g[i][j];

            if(j != n - 1) cout << " ";
            else cout << endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:51: error: 'prlong' was not declared in this scope; did you mean 'ulong'?
   18 |                 if(i == j && g[i][j] < 0) return !prlong longf("NEGATIVE CYCLE\n");
      |                                                   ^~~~~~
      |                                                   ulong
a.cc:18:57: error: expected ';' before 'longf'
   18 |                 if(i == j && g[i][j] < 0) return !prlong longf("NEGATIVE CYCLE\n");
      |                                                         ^~~~~~
      |                                                         ;
a.cc:18:58: error: 'longf' was not declared in this scope; did you mean 'long'?
   18 |                 if(i == j && g[i][j] < 0) return !prlong longf("NEGATIVE CYCLE\n");
      |                                                          ^~~~~
      |                                                          long
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
 
int n,e,dp[110][110];
int s,t,d;
//
void floyd(){
	for(int k=0;k<n;k++){
		for(int i=0;i<n;i++){
			if(dp[i][k]==INF) continue;
			for(int j=0;j<n;j++){
				if(dp[k][j]==INF) continue;
				dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j]);
			}
		}
	}
}
Init(int n){
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++){
			if(i==j) dp[i][j]=0;
			else dp[i][j]=INF;
		}
}
int main(){
	ios::sync_with_stdio(false);
	cin>>n>>e;
	Init(n);
	for(int i=0;i<e;i++){
	   cin>>s>>t>>d;
	   dp[s][t]=d;
	}
	floyd();
	int flag = 0;
	for(int i=0;i<n;i++){
		if(dp[i][i]<0){
			flag=1;break;
		}
	}
	if(flag==1)    cout<<"NEGATIVE CYCLE\n";
	else{
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(j) cout<<" ";
				if(dp[i][j]==INF) cout<<"INF";
				else cout<<dp[i][j];
			}	
			cout<<endl;
		}
	
	}	
	return 0;
}



Compiler output:
a.cc:19:1: error: ISO C++ forbids declaration of 'Init' with no type [-fpermissive]
   19 | Init(int n){
      | ^~~~
a.cc: In function 'int Init(int)':
a.cc:25:1: warning: no return statement in function returning non-void [-Wreturn-type]
   25 | }
      | ^
Language: C++

//All Pairs Shortest Path
#include <iostream>

using namespace std;

static const int MAX = 100;
int V, E;
long long A[MAX][MAX];

void warshallFloyd() {
    for(int k = 1; k < V; k++) {
        for(int i = 0; i < V; i++) {
            if(A[i][k] == LONG_LONG_MAX) continue;
            for(int j = 0; j < V; j++) {
                if(A[k][j] == LONG_LONG_MAX) continue;
                A[i][j] = min(A[i][j], A[i][k] + A[k][j]);
            }
        }
    }
}

int main() {
    int s, t;
    long long d;
    cin >> V >> E;

    for (int i = 0; i < MAX; i++) {
        for (int j = 0; j < MAX; j++) A[i][j] = (i == j ? 0 : LONG_LONG_MAX);
    }
    for (int i = 0; i < E; i++) {
        cin >> s >> t >> d;
        A[s][t] = d;
    }

    warshallFloyd();

    bool negative = false;
    for (int i = 0; i < V; i++) {
        if(A[i][i] < 0) negative = true;
    }

    if(negative) cout << "NEGATIVE CYCLE" << endl;
    else {
        for (int i = 0; i < V; i++) {
            for (int j = 0; j < V; j++) {
                if(j != 0) cout << " ";
                if(A[i][j] == LONG_LONG_MAX) cout << "INF";
                else cout << A[i][j];
            }
            cout << endl;
        }
    }
}


Compiler output:
a.cc: In function 'void warshallFloyd()':
a.cc:13:27: error: 'LONG_LONG_MAX' was not declared in this scope
   13 |             if(A[i][k] == LONG_LONG_MAX) continue;
      |                           ^~~~~~~~~~~~~
a.cc:15:31: error: 'LONG_LONG_MAX' was not declared in this scope
   15 |                 if(A[k][j] == LONG_LONG_MAX) continue;
      |                               ^~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:28:63: error: 'LONG_LONG_MAX' was not declared in this scope
   28 |         for (int j = 0; j < MAX; j++) A[i][j] = (i == j ? 0 : LONG_LONG_MAX);
      |                                                               ^~~~~~~~~~~~~
a.cc:47:31: error: 'LONG_LONG_MAX' was not declared in this scope
   47 |                 if(A[i][j] == LONG_LONG_MAX) cout << "INF";
      |                               ^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define MOD 1000000007
#define INF 1000000000000000
#define fi first
#define se second
#define all(v) v.begin(),v.end()
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
#define pb push_back
//struct edge{int to,cost;};
struct edge{int from,to,cost;};
typedef pair<int,int> P;
int n,m,d[1010];
edge es[2010];
bool NEGATIVE_CYCLE;
void bell(int s){
	fill(d,d+n,INF);
	d[s]=0;
	for(int i=0;i<=n;i++){
		bool update=false;
		for(edge e:es){
			if(d[e.from]!=INF&&d[e.to]>d[e.from]+e.cost){
				d[e.to]=d[e.from]+e.cost;
				update=true;
			}
		}
		if(i==n&&update)NEGATIVE_CYCLE=1;
	}
}
signed main(){
	cin>>n>>m;
	rep(i,m){
		int a,b,c;
		cin>>a>>b>>c;
		es[i]={a,b,c};
	}
	rep(i,n){
		bell(r);
		if(NEGATIVE_CYCLE){
			puts("NEGATIVE CYCLE");
			return 0;
		}
		rep(j,n){
			if(d[j]==INF)puts("INF");
			else cout<<d[j]<<endl;
		}
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:41:22: error: 'r' was not declared in this scope
   41 |                 bell(r);
      |                      ^
Language: C++

#include <cstdio>
#include <queue>
#include <algorithm>

#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define INF 2000000000000LL
using namespace std;

typedef long long Weight;
typedef pair<Weight,pair<int,int> >Edge;

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<Weight> Array;
typedef vector<Array> Matrix;

bool shortestPath(Graph &g, Matrix &dist, vector<vector<int> > &prev){
	int n = g.size()-1;
	Array h(n+1);
	h.assign(n,INF);
	for(int k=0;k<n+1;k++)for(int i=0;i<n+1;i++)FOR(e,g[i]){
		if (h[e->second.first]<INF && e->first<INF && h[e->second.second] > h[e->second.first] + e->first){
			h[e->second.second] = h[e->second.first] + e->first;
			if(k==n)return false; // negative cycle
		}
	}
	int(int i=0;i<n;i++)FOR(e,g[i])e->first+=h[i]-h[e->second.second];
	dist.assign(n, Array(n,INF));
	prev.assign(n, vector<int>(n,-2));
	for(int s=0;s<n;s++){
		priority_queue<Edge> Q;
		Q.push(make_pair(0,make_pair(s, s)));
		for(;!Q.empty();){
			Edge e = Q.top(); Q.pop();
			if(prev[s][e.second.second]!=-2)continue;
			prev[s][e.second.second] = e.second.first;
			FOR(f,g[e.second.second]){
				if(e.first<INF && f->first<INF && dist[s][f->second.second] > -e.first + f->first){
					dist[s][f->second.second] = -e.first + f->first;
					Q.push(make_pair(-(-e.first + f->first),make_pair(f->second.first, f->second.second)));
				}
			}
		}
		for(int u=0;u<n;u++){
			if(dist[s][u]<INF)dist[s][u] += h[u] - h[s];
		}
	}
	return true;
}

int main(){
	int r,T,V,E,s,t,e,i,j;
	scanf("%d%d",&V,&E);
	Graph g(V+1);
	Matrix dist;
	vector<vector<int> > prev;
	for(i=0;i<V;i++)g[i].push_back(make_pair(0,make_pair(i,i)));
	for(i=0;i<V;i++)g[V].push_back(make_pair(0,make_pair(V,i)));
	for(;E--;)scanf("%d%d%d",&s,&t,&e),g[s].push_back(make_pair(e,make_pair(s,t)));
	if(!shortestPath(g,dist,prev))puts("NEGATIVE CYCLE");
	else for(i=0;i<V;i++)for(j=0;j<V;j++){
		if(dist[i][j]>=INF)printf("INF");
		else printf("%lld",dist[i][j]);
		printf(j<V-1?" ":"\n");
	}
}

Compiler output:
a.cc: In function 'bool shortestPath(Graph&, Matrix&, std::vector<std::vector<int> >&)':
a.cc:27:9: error: expected primary-expression before 'int'
   27 |         int(int i=0;i<n;i++)FOR(e,g[i])e->first+=h[i]-h[e->second.second];
      |         ^~~
a.cc:27:21: error: 'i' was not declared in this scope
   27 |         int(int i=0;i<n;i++)FOR(e,g[i])e->first+=h[i]-h[e->second.second];
      |                     ^
a.cc:27:33: error: 'e' was not declared in this scope
   27 |         int(int i=0;i<n;i++)FOR(e,g[i])e->first+=h[i]-h[e->second.second];
      |                                 ^
a.cc:5:57: note: in definition of macro 'FOR'
    5 | #define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
      |                                                         ^
Language: C++

from __future__ import division
from collections import defaultdict, deque
from heapq import heappush, heappop
from sys import stdin


def floyd(graph):
	n = len(graph["nodes"])
	dis = [[10 ** 20 for _ in range(n)] for _ in range(n)]
	for i in range(n): dis[i][i] = 0

	for x in graph["nodes"]:
		for (y, w) in graph["adj"][x]:
			dis[x][y] = w


	for k in range(n):
		for i in range(n):
			for j in range(n):
				if dis[i][k] < 10 ** 20 and dis[k][j] < 10 ** 20:
					dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j])

	return dis


if __name__ == '__main__':
	V, E= map(int, stdin.readline().strip().split())
	graph = {}
	graph["nodes"] = [i for i in range(V)]
	graph["edges"] = []
	graph["adj"] = defaultdict(list)
	for _ in range(E):
		x, y, w = map(int, stdin.readline().strip().split())
		graph["edges"].append((x, y, w))
		graph["adj"][x].append((y, w))

	dis = floyd(graph)

	negcycle = False

	for i in range(len(graph["nodes"])):
		if dis[i][i] < 0:
			negcycle = True

	if negcycle:
		print "NEGATIVE CYCLE"
	else:
		for row in dis:
			print ' '.join(map(lambda x: str(x) if x < 10 ** 20 else "INF", row))

Compiler output:
a.cc:26:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   26 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'from' does not name a type
    1 | from __future__ import division
      | ^~~~
a.cc:29:9: error: 'graph' does not name a type
   29 |         graph["nodes"] = [i for i in range(V)]
      |         ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
int N,M;

int dist[100][100];
const int INF=INF_MAX/10000;
signed main(){
    fill_n(*dist,10000,INF);

    cin>>N>>M;
    for(int i=0;i<N;i++)dist[i][i]=0;
    for(int i=0;i<M;i++){
        int a,b,c;
        cin>>a>>b>>c;
        dist[a][b]=c;
    }

    for(int k=0;k<N;k++)
    for(int i=0;i<N;i++)
    for(int j=0;j<N;j++)if(dist[i][k]!=INF&&dist[k][j]!=INF)
    dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);

    for(int i=0;i<N;i++){
        if(dist[i][i]<0){
            cout<<"NEGATIVE CYCLE"<<endl;
            return 0;
        }
    }
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            cout<<(j?" ":"");
            if(dist[i][j]==INF)cout<<"INF";
            else cout<<dist[i][j];
        }
        cout<<endl;
    }
    return 0;
}

Compiler output:
a.cc:7:15: error: 'INF_MAX' was not declared in this scope; did you mean 'INT_MAX'?
    7 | const int INF=INF_MAX/10000;
      |               ^~~~~~~
      |               INT_MAX
Language: C++

#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
using namespace std;

#define TEISU 1000000
#define INF 1145141919810LL
#define BLACK 2
#define GRAY 1
#define WHITE 0
#define MAX_N 500000

long long d[MAX_N];
long long color[MAX_N];
vector<long long> x[MAX_N];

priority_queue<long long,vector<long long>,greater<long long>>Q;

void _memset(){
	memset(d,0,sizeof(d));
	memset(color,0,sizeof(color));
}

void dijkstra(){
	while(!Q.empty()){
		long long A=Q.top()/TEISU;
		long long B=Q.top()%TEISU;
		Q.pop();
		color[B]=BLACK;

		if(d[B]<A*(-1))continue;

		for(int v=0;v<x[B].size();v++){
			int w=x[B][v]/TEISU;

			if(color[w]==BLACK)continue;

			if(d[w]>d[B]+x[B][v]%TEISU){

				d[w]=d[B]+x[B][v]%TEISU;
				Q.push(d[w]*TEISU+w);
				color[w]=GRAY;

			}
		}
	}
}

int main(){
	long long n,m,r,a,b,c;
	cin>>n>>m;
	for(int i=0;i<m;i++){
		cin>>a>>b>>c;
		x[a].push_back(b*TEISU+c);
	}
	for(int h=0;h<n;h++){
		_memset();
		r=h;
		Q.push(r);
		for(int i=0;i<MAX_N;i++){color[i]=WHITE;d[i]=INF;}
		d[r]=0;color[r]=GRAY;
		dijkstra();
		for(int i=0;i<n;i++){if(i){cout<<' ';}if(d[i]==INF){cout<<"INF";}else{cout<<d[i];}}
		cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'void _memset()':
a.cc:21:9: error: 'memset' was not declared in this scope
   21 |         memset(d,0,sizeof(d));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<queue>
  +++ |+#include <cstring>
    4 | #include<vector>
Language: C++

// GRL_1_C
#include <iostream>
#include <vector>
#include <queue>
const int N = INT_MAX;
using namespace std;

struct edge{
	int adj;
	int dis;
};

int main(){
	int V, E, s, t, d, x, count;
	vector<vector<edge> > A;
	vector<vector<int> > distance;
	bool pos = true;
	edge e;

	cin>>V>>E;

	A.resize(V);
	distance.resize(V);
	for(int i=0;i<V;i++){
		for(int j=0;j<V;j++){
			if(i != j)
				distance[i].push_back(N);
			else
				distance[i].push_back(0);
		}
	}

	for(int j=0;j<E;j++){
		cin>>s>>t>>d;
		e.adj = t;
		e.dis = d;
		A[s].push_back(e);
	}
	
	for(int r=0;r<V;r++){
		count = 0;
		queue<int> ver;
		ver.push(r);

		while(count<=V){
			queue<int> vern;
			while(!ver.empty()){
				x = ver.front();
				for(int i=0;i<A[x].size();i++){
					if(distance[r][A[x][i].adj] > distance[r][x] + A[x][i].dis){
						distance[r][A[x][i].adj] = distance[r][x] + A[x][i].dis;
						vern.push(A[x][i].adj);
					}
				}
				ver.pop();
			}
			if(vern.empty()) break;
			ver = vern;
			count++;
		}
		if(count > V)
			pos = false;
	}

	if(!pos){
		cout<<"NEGATIVE CYCLE"<<endl;
	}else{
		for(int i=0;i<V;i++){
			for(int j=0;j<V;j++){
				if(j != 0) cout<<" ";
				if(distance[i][j] >= N)
					cout<<"INF";
				else
					cout<<distance[i][j];
			}
			cout<<endl;
		}
	}

	return 0;
}

Compiler output:
a.cc:5:15: error: 'INT_MAX' was not declared in this scope
    5 | const int N = INT_MAX;
      |               ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <queue>
  +++ |+#include <climits>
    5 | const int N = INT_MAX;
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const ll inf=1e17;
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll,ll> pii;
int main(){
	int n,m;
	cin>>n>>m;
	vvi cost(n,vi(n,inf));
	rep(i,n)cost[i][i]=0;	
	while(m--){
		int a,b,c;
		cin>>a>>b>>c;
		cost[a][b]=c;
	}
	rep(k,n)rep(i,n)rep(j,n)if(cost[i][k]!=inf&&cost[k][j]!=inf)
		cost[i][j]=min(cost[i][j],cost[i][k]+cost[k][j]);
	int h=true;
	rep(i,n)if(cost[i][i]<0)h=false;
	if(!h){
		cout<<"NEGATIVE CYCLE"<<endl;
	}else{
		rep(i,n){
			rep(j,n){
				if(j)cout<<" ";
				if(cost[i][j]==inf)cout<<"INF";
				else cout<<cost[i][j];
			}
			cout<<endl;
		}
	}
}

Compiler output:
a.cc:20:7: error: 'll' does not name a type; did you mean 'all'?
   20 | const ll inf=1e17;
      |       ^~
      |       all
a.cc: In function 'int main()':
a.cc:29:25: error: 'inf' was not declared in this scope; did you mean 'ynf'?
   29 |         vvi cost(n,vi(n,inf));
      |                         ^~~
      |                         ynf
Language: C++

#include<cstdio>
#include<algorithm>
#define int long long
using namespace std;

const int INF = 10000000000;
int v,e;
int d[100][100];

int main(){
  scanf("%d %d",&v,&e);
  fill(d[0],d[0]+10000,INF);
  for(int i=0;i<v;i++) d[i][i] = 0;
  for(int i=0;i<e;i++){
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    d[a][b] = c;
  }
  for(int k=0;k<v;k++){
    for(int i=0;i<v;i++){
      for(int j=0;j<v;j++){
        if(d[i][k]!=INF&&d[k][j]!=INF){
          d[i][j] = min(d[i][j],d[i][k]+d[k][j]);
        }
      }
    }
  }
  bool flag = false;
  for(int i=0;i<v;i++){
    if(d[i][i]<0){
      flag = true;
    }
  }
  if(flag){
    printf("NEGATIVE CYCLE\n");
  }else{
    for(int i=0;i<v;i++){
      for(int j=0;j<v;j++){
        if(j!=0) printf(" ");
        if(d[i][j]==INF) printf("INF");
        else printf("%d",d[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<cstdio>
#include<algorithm>
#define int long long
using namespace std;

const int INF = 10000000000;
int v,e;
int d[100][100];

void main(){
  scanf("%d %d",&v,&e);
  fill(d[0],d[0]+10000,INF);
  for(int i=0;i<v;i++) d[i][i] = 0;
  for(int i=0;i<e;i++){
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    d[a][b] = c;
  }
  for(int k=0;k<v;k++){
    for(int i=0;i<v;i++){
      for(int j=0;j<v;j++){
        if(d[i][k]!=INF&&d[k][j]!=INF){
          d[i][j] = min(d[i][j],d[i][k]+d[k][j]);
        }
      }
    }
  }
  bool flag = false;
  for(int i=0;i<v;i++){
    if(d[i][i]<0){
      flag = true;
    }
  }
  if(flag){
    printf("NEGATIVE CYCLE\n");
  }else{
    for(int i=0;i<v;i++){
      for(int j=0;j<v;j++){
        if(j!=0) printf(" ");
        if(d[i][j]==INF) printf("INF");
        else printf("%d",d[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}

Compiler output:
a.cc:10:1: error: '::main' must return 'int'
   10 | void main(){
      | ^~~~
Language: C++

#include <bits/stdc++.h>
#define INF 100000000000000000ll
#define MAX_V 1000
#define MAX_E 2000
using namespace std;

int V, E, r;
long long d[MAX_V][MAX_V];

bool Warshall_Floyd() {
	for (int k = 0; k < V; k++) {
		for (int i = 0; i < V; i++) {
			for (int j = 0; j < V; j++) {
				if (d[i][k] != INF && d[k][j] != INF && d[i][j] > d[i][k] + d[k][j]) {
					d[i][j] = d[i][k] + d[k][j];
				}
			}
		}
	}
	for (int i = 0; i < V; i++)
		if (d[i][i] < 0) return true;
	return false;
}

int main()
{
	int r;
	cin >> V >> E >> r;
	for (int i = 0; i < V; i++) {
		for (int j = 0; j < V; j++) {
			if (i == j)
				d[i][j] = 0;
			else
				d[i][j] = INF;
		}
	}
	for (int i = 0, s, t, c; i < E; i++) {
		cin >> s >> t >> c;
		d[s][t] = c;
	}

	if (!Warshall_Floyd()) {
		for (int i = 0; i < V; i++) {
			for (int j = 0; j < V; j++) {
				if (d[i] == INF)
					cout << "INF" << endl;
				else
					cout << d[i] << endl;
			}
		}
	}
	else {
		cout << "NEGATIVE CYCLE" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:42: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   45 |                                 if (d[i] == INF)
      |                                          ^
Language: C++

#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
#define MAXN 100+2
int map1[MAXN][MAXN];
int n,m;
void input(){
	cin>>n>>m;
	int we,xx,yy;
	for(int i=0;i<n;++i){
		for(int j=0;j<n;++j){
			map1[i][j]=1000000000;
		}
	}
	for(int i=0;i<m;++i){
		cin>>xx>>yy>>we;
		map1[xx][yy]=we;
	}
	for(int i=0;i<n;++i){
		map1[i][i]=0;
	}
}
void floyd(){
    for(int k=0;k<n;++k){
	for(int i=0;i<n;++i){
		for(int j=0;j<n;++j){
				map1[i][j]=min(map1[i][k]+map1[k][j],map1[i][j]);
			}
		}
	}
	for(int k=0;k<n;++k){
	for(int i=0;i<n;++i){
		for(int j=0;j<n;++j){
			for(int k=0;k<n;++k){
				if(map1[i][j]>map1[i][k]+map1[k][j]){
					cout<<"NEGATIVE CYCLE"<<endl;
				    return;
				}
			}
		}
	}
	for(int i=0;i<n;++i){
		for(int j=0;j<n-1;++j){
			if(map1[i][j]!=1000000000) cout<<map1[i][j]<<" ";
		    else cout<<"INF"<<" ";
		}
		if(map1[i][n-1]!=1000000000) cout<<map1[i][n-1]<<endl;
	    else cout<<"INF"<<endl;
	}
}
int main(){
	input();
	floyd();
	return 0;
}

Compiler output:
a.cc: In function 'void floyd()':
a.cc:52:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   52 | int main(){
      |         ^~
a.cc:52:9: note: remove parentheses to default-initialize a variable
   52 | int main(){
      |         ^~
      |         --
a.cc:52:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:52:11: error: a function-definition is not allowed here before '{' token
   52 | int main(){
      |           ^
a.cc:56:2: error: expected '}' at end of input
   56 | }
      |  ^
a.cc:24:13: note: to match this '{'
   24 | void floyd(){
      |             ^
Language: C++

//knasiri
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<set>
#include<vector>
#define f first
#define s second
#define pb push_back
using namespace std;
pair<int,int>a[20000+10];
const long int INF=9999999;
int dis[10000];
int w[10000];
int n,m,r;

bool neg_cycle=false;
void belman_ford(int x)
{
	for(int i=0;i<n;i++)
	{
		dis[i]=INF;
	}
	dis[x]=0;
	for(int i=0;i<=n+1;i++)
	{
		for(int j=0;j<m;j++)
		{
			int u=a[j].f;
			int v=a[j].s;
			if(i>=(n-1))
			{
				if(((dis[u]+w[j])<dis[v])&&dis[u]!=INF)
					neg_cycle=true;
			}
			else
			{
				if(dis[u]!=INF)
				{
					dis[v]=min((dis[u]+w[j]),dis[v]);
				}
			}
			
			//cout<<v<<" <------> "<<dis[v]<<endl;
		}

	}
}
int main()
{
	cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		cin>>a[i].f>>a[i].s>>w[i];
	}
	for(int i=0;i<n;i++)
	{
		belman_ford(i);
		if(neg_cycle)
		{
			cout<<"NEGATIVE CYCLE "<<endl;
			return 0;
		}
		for(int j=0;j<n;j++)
		{
			if(dis[j]==INF)
				cout<<"INF";
cout<<" ";
			else
				cout<<dis[j];
		}
		cout<<endl;
	}
	

///ddddddddd//dd//d//dd/dd//d
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:25: error: 'else' without a previous 'if'
   70 |                         else
      |                         ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>

using namespace std;

static const int MAX = 100;
static const long long INFTY = (1LL << 31);

int n;
long long d[MAX][MAX];

void floyd()
{
	for (int k = 0; k < n; ++k)
	{
		for (int i = 0; i < n; ++i)
		{
			if (d[i][k] == INFTY) continue;
			for (int j = 0; j < n; ++j)
			{
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
}

int main()
{
	int e, u, v, c;
	cin >> n >> e;

	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < n; ++j)
		{
			d[i][j] = ((i == j) ? 0 : INFINITY);
		}
	}

	for (int i = 0; i < e; ++i)
	{
		cin >> u >> v >> c;
		d[u][v] = c;
	}

	floyd();
	bool negitive = false;
	for (int i = 0; i < n; ++i)
	{
		if (d[i][i] < 0) negitive = true;
	}

	if (negitive)
	{
		cout << "NEGATIVE CYCLE" << endl;
	}
	else
	{
		for (int i = 0; i < n; ++i)
		{
			for (int j = 0; j < n; ++j)
			{
				if (j) cout << " ";
				if (d[i][j] == INFINITY) cout << "INF";
				else cout << d[i][j];
			}
			cout << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:51: error: 'INFINITY' was not declared in this scope; did you mean 'INFTY'?
   38 |                         d[i][j] = ((i == j) ? 0 : INFINITY);
      |                                                   ^~~~~~~~
      |                                                   INFTY
a.cc:66:48: error: 'INFINITY' was not declared in this scope; did you mean 'INFTY'?
   66 |                                 if (d[i][j] == INFINITY) cout << "INF";
      |                                                ^~~~~~~~
      |                                                INFTY
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
using namespace std;

static const int MAX=100;
static const long long INF=(1LL<<32);

int n;
long long d[MAX][MAX];

void wf(){
  for(int k=0;k<n;k++){
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
        d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
      }
    }
  }
}

int main(){
  int e,u,v,c;
  cin>>n>>e;

  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(i==j) d[i][j]=0;
      else d[i][j]=INF;
    }
  }

  for(int i=0;i<e;i++){
    cin>>u>>v>>c;
    d[u][v]=c;
  }

wf();

  bool nagetive=false;
  for(int i=0;i<n;i++) if(d[i][i]<0) negative=true;

  if(negative){
    cout<<"NEGATIVE CYCLE"<<endl;
  }
  else{
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
       if(j) cout<<" ";
       if(d[i][j]==INF) cout<<"INF";
       else cout<<d[i][j];
      }
      cout<<endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:38: error: 'negative' was not declared in this scope; did you mean 'nagetive'?
   42 |   for(int i=0;i<n;i++) if(d[i][i]<0) negative=true;
      |                                      ^~~~~~~~
      |                                      nagetive
a.cc:44:6: error: 'negative' was not declared in this scope; did you mean 'nagetive'?
   44 |   if(negative){
      |      ^~~~~~~~
      |      nagetive
Language: C++

import java.util.*;

class Main {
    //Floyd Warshall's Algorithm
    private static final long MAX = (long) (2e10 + 1);
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        int V = scanner.nextInt();
        int E = scanner.nextInt();

        long[][] dist = new long[V][V];

        for(int i = 0; i < V; ++i){
            Arrays.fill(dist[i], MAX);
            dist[i][i] = 0;
        }

        for(int i = 0; i < E; ++i){
            int u = scanner.nextInt();
            int v = scanner.nextInt();
            int weight = scanner.nextInt();

            dist[u][v] = weight;
        }

        for(int k = 0; k < V; ++k){
            for(int i = 0; i < V; ++i){
                for(int j = 0; j < V; ++j){
                    if(dist[i][k] != MAX && dist[k][j] != MAX && dist[i][k] + dist[k][j] < dist[i][j]){
                        dist[i][j] = dist[i][k] + dist[k][j];
                    }
                }
                
                if(dist[i][i] < 0){
                    System.out.println("NEGATIVE CYCLE");
                    return;
                }
            }
        }

        for(int i = 0; i < V; ++i){
            for(int j = 0; j < V; ++j){
                System.out.print(dist[i][j] == MAX ? "INF" : dist[i][j]);
                if(j != V - 1){
                    System.out.print(" ");
                }
            }
            System.out.println("");
        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:12: error: expected ':' before 'static'
    5 |     private static final long MAX = (long) (2e10 + 1);
      |            ^~~~~~~
      |            :
a.cc:5:20: error: 'final' does not name a type
    5 |     private static final long MAX = (long) (2e10 + 1);
      |                    ^~~~~
a.cc:6:11: error: expected ':' before 'static'
    6 |     public static void main(String[] args) throws Exception {
      |           ^~~~~~~
      |           :
a.cc:6:29: error: 'String' has not been declared
    6 |     public static void main(String[] args) throws Exception {
      |                             ^~~~~~
a.cc:6:38: error: expected ',' or '...' before 'args'
    6 |     public static void main(String[] args) throws Exception {
      |                                      ^~~~
a.cc:6:42: error: expected ';' at end of member declaration
    6 |     public static void main(String[] args) throws Exception {
      |                                          ^
      |                                           ;
a.cc:6:44: error: 'throws' does not name a type
    6 |     public static void main(String[] args) throws Exception {
      |                                            ^~~~~~
a.cc:51:2: error: expected ';' after class definition
   51 | }
      |  ^
      |  ;
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

static const int INFTY = (1 << 30);

void WarshallFloyd(int weight[][100], int verNum) {

	//k????¢??????????????????????????????°????¢??????????????????????????±???????
	//???????????????????¨???????
	for (int k = 0; k < verNum; k++)
		for (int i = 0; i < verNum; i++) {
			//?????????????????£?????????????????§??´??°???????????????????????????
			if (weight[i][k] == INFTY) continue;
			for (int j = 0; j < verNum; j++) {
				if (weight[k][j] == INFTY) continue;
				weight[i][j] = min(weight[i][j], weight[i][k] + weight[k][j]);
			}
		}
}

int main() {

	long long weight[100][100];
	int verNum;
	int edgeNum;
	cin >> verNum >> edgeNum;

	//Initialize
	for (int i = 0; i < verNum; i++)
		for (int j = 0; j < verNum; j++)
			weight[i][j] = (i == j) ? 0 : INFTY;

	for (int i = 0; i < edgeNum; i++) {
		int first_ver, second_ver, wei;
		cin >> first_ver >> second_ver >> wei;
		weight[first_ver][second_ver] = wei;
	}

	WarshallFloyd(weight, verNum);

	//?????¨???
	bool negative = false;
	for (int i = 0; i < verNum; i++)
		if (weight[i][i] < 0) negative = true;

	if (negative)
		cout << "NEGATIVE CYCLE" << endl;
	else {
		for (int i = 0; i < verNum; i++) {
			for (int j = 0; j < verNum; j++) {
				if (j) cout << " ";

				string verVal;
				if (weight[i][j] == INFTY) verVal = "INF";
				else                                  verVal = to_string(weight[i][j]);

				cout << verVal;
			}
			cout << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:23: error: cannot convert 'long long int (*)[100]' to 'int (*)[100]'
   41 |         WarshallFloyd(weight, verNum);
      |                       ^~~~~~
      |                       |
      |                       long long int (*)[100]
a.cc:8:24: note:   initializing argument 1 of 'void WarshallFloyd(int (*)[100], int)'
    8 | void WarshallFloyd(int weight[][100], int verNum) {
      |                    ~~~~^~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <limits>
using namespace std;

//?????????????????\???????????§?????§??§19???????¶???????????????§???????????????
static const int INFTY = INT_MAX;

void WarshallFloyd(int weight[][100], int verNum) {

	//k????¢??????????????????????????????°????¢??????????????????????????±???????
	//???????????????????¨???????
	for (int k = 0; k < verNum; k++)
		for (int i = 0; i < verNum; i++) {
			//?????????????????£?????????????????§??´??°???????????????????????????
			if (weight[i][k] == INFTY) continue;
			for (int j = 0; j < verNum; j++) {
				if (weight[k][j] == INFTY) continue;
				weight[i][j] = min(weight[i][j], weight[i][k] + weight[k][j]);
			}
		}
}

int main() {

	int weight[100][100];
	int verNum;
	int edgeNum;
	cin >> verNum >> edgeNum;

	//Initialize
	for (int i = 0; i < verNum; i++)
		for (int j = 0; j < verNum; j++)
			weight[i][j] = (i == j) ? 0 : INFTY;

	for (int i = 0; i < edgeNum; i++) {
		int first_ver, second_ver, wei;
		cin >> first_ver >> second_ver >> wei;
		weight[first_ver][second_ver] = wei;
	}

	WarshallFloyd(weight, verNum);

	//?????¨???
	bool negative = false;
	for (int i = 0; i < verNum; i++)
		if (weight[i][i] < 0) negative = true;

	if (negative)
		cout << "NEGATIVE CYCLE" << endl;
	else {
		for (int i = 0; i < verNum; i++) {
			for (int j = 0; j < verNum; j++) {
				if (j) cout << " ";

				string verVal;
				if (weight[i][j] == INFTY) verVal = "INF";
				else                                  verVal = to_string(weight[i][j]);

				cout << verVal;
			}
			cout << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc:8:26: error: 'INT_MAX' was not declared in this scope
    8 | static const int INFTY = INT_MAX;
      |                          ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <limits>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;
#define INT(x) int x; scanf("%d",&x)
#define LL(x) ll x; scanf("%lld",&x)
#define INPUT(x) cin >> x
#define REP1(x,n) for(int x = 0; x < n; x++)
#define REP2(x,s,e) for(int x = s; x <= e; x++)
#define RREP1(x,n) for(int x = n-1; x >= 0; x--)
#define RREP2(x,s,e) for(int x = s; x >= e; x--)
#define BR printf("\n")
#define INF_INT 2147483647
#define INF_LL 9223372036854775807

typedef long long ll;

int main(){
    //?????????????????¨?????´??°???????????§???????????¢??????A[N][N]??????
    //???????????¢
    int A[100][100];
    
    //?????°
    INT(N);INT(E);
    
    //?????????
    REP1(i,N){
        REP1(i,N){
            if(i != j){
                A[i][j] = INF_INT;
            }else{
                A[i][j] = 0;
            }
        }
    }
    
    //??\???
    REP1(i,E){
        INT(i);INT(j);INT(d);
        //A^0??¨??????????????????
        A[i][j] = d;
        A[j][i] = d;
    }
    
    REP1(k,N){
        REP1(i,N){
            REP1(j,N){
                A[i][j] = min(A[i][j], A[i][k] + A[k][j]);
            }
        }
    }
    
    REP1(i,N){
        if(A[i][i] < 0){
            cout << "NEGATIVE CYCLE" << endl;
            return 0;
        }
    }
    
    REP1(i,N){
        REP1(j,N){
            cout << A[i][j] << " ";
        }
        cout << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:21: error: 'j' was not declared in this scope
   35 |             if(i != j){
      |                     ^
a.cc:45:13: error: redeclaration of 'int i'
   45 |         INT(i);INT(j);INT(d);
      |             ^
a.cc:11:20: note: in definition of macro 'INT'
   11 | #define INT(x) int x; scanf("%d",&x)
      |                    ^
a.cc:44:10: note: 'int i' previously declared here
   44 |     REP1(i,E){
      |          ^
a.cc:14:27: note: in definition of macro 'REP1'
   14 | #define REP1(x,n) for(int x = 0; x < n; x++)
      |                           ^
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;
#define INT(x) int x; scanf("%d",&x)
#define LL(x) ll x; scanf("%lld",&x)
#define INPUT(x) cin >> x
#define REP1(x,n) for(int x = 0; x < n; x++)
#define REP2(x,s,e) for(int x = s; x <= e; x++)
#define RREP1(x,n) for(int x = n-1; x >= 0; x--)
#define RREP2(x,s,e) for(int x = s; x >= e; x--)
#define BR printf("\n")
#define INF_INT 2147483647
#define INF_LL 9223372036854775807

typedef long long ll;

int main(){
    //?????????????????¨?????´??°???????????§???????????¢??????A[N][N]??????
    //???????????¢
    int A[100][100];
    
    //?????°
    INT(N);INT(E);
    
    //?????????
    REP1(i,N){
        REP1(i,N){
            if(i != j){
                A[i][j] = INF_INT;
            }else{
                A[i][j] = 0;
            }
        }
    }
    
    //??\???
    REP1(i,E){
        INT(s);INT(t);INT(d);
        //A^0??¨??????????????????
        A[s][t] = d;
        A[t][s] = d;
    }
    
    REP1(k,N){
        REP1(i,N){
            REP1(j,N){
                A[i][j] = min(A[i][j], A[i][k] + A[k][j]);
            }
        }
    }
    
    REP1(i,N){
        if(A[i][i] < 0){
            cout << "NEGATIVE CYCLE" << endl;
            return 0;
        }
    }
    
    REP1(i,N){
        REP1(j,N){
            cout << A[i][j] << " ";
        }
        cout << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:21: error: 'j' was not declared in this scope
   35 |             if(i != j){
      |                     ^
Language: C++

#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e18
#define int ll
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
signed main(){
    int v,e; cin>>v>>e;
    vector<vector<int>>d(v,vector<int>(v,LLONG_MAX));
    rep(i,e){
        int a,b,c; cin>>a>>b>>c;
        d[a][b]=min(d[a][b],c);
    }
    rep(i,v)d[i][i]=0;
    rep(k,v)rep(i,v)rep(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
    rep(i,v)if(d[i][i]<0)return puts("NEGATIVE CYCLE")*0;
    rep(i,v){rep(j,v){if(j)cout<<" "; if(d[i][j]!=LLONG_MAX)cout<<d[i][j];else cout<<"INF";}cout<<endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:42: error: 'LLONG_MAX' was not declared in this scope
   46 |     vector<vector<int>>d(v,vector<int>(v,LLONG_MAX));
      |                                          ^~~~~~~~~
a.cc:23:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   22 | #include <stack>
  +++ |+#include <climits>
   23 | #define vi vector<int>
Language: C++

#include<bits/stdc++.h>
#define INF 2147483647
using namespace std;
typedef struct ee{
  int cost,to;
}edge;
int main(){
  int v,e;
  cin>>v>>e;
  vector<vector<ee> >E(v);
  int dp[v+1][v+1]={};
  fill_n(dp,(v+1)*(v+1),INF);
  for(int i=0;i<e;i++){
    int a,b,c;
    cin>>a>>b>>c;
    dp[a][b]=c;
  }
  for(int k=0;k<v;k++){
    for(int i=0;i<v;i++){
      for(int j=0;j<v;j++){
	dp[i][j]=min(dp[i][j],d[i][k]+d[k][j]);
      }
    }
  }
  int flag=1;
  for(int i=0;i<v;i++){
    for(int j=0;j<v;j++){
      if(dp[i][j]<0){
	flag=0;
	cout<<"NEGATIVECYCLE"<<endl;
	break;
      }
    }
    if(flag==0)
      break;
  }
  if(flag){
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	if(dp[i][j]==INF)
	  cout<<"INF";
	else
	  cout<<dp[i][j];
	if(j==n-1)
	  cout<<" ";
      }
      cout<<endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: no matching function for call to 'fill_n(int [(v + 1)][(v + 1)], int, int)'
   12 |   fill_n(dp,(v+1)*(v+1),INF);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:1178:5: note: candidate: 'template<class _OI, class _Size, class _Tp> _OI std::fill_n(_OI, _Size, const _Tp&)'
 1178 |     fill_n(_OI __first, _Size __n, const _Tp& __value)
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1178:5: note:   template argument deduction/substitution failed:
a.cc:12:9: note:   variable-sized array type 'int (*)[(v + 1)]' is not a valid template argument
   12 |   fill_n(dp,(v+1)*(v+1),INF);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:195:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::fill_n(_ExecutionPolicy&&, _ForwardIterator, _Size, const _Tp&)'
  195 | fill_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __count, const _Tp& __value);
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:195:1: note:   candidate expects 4 arguments, 3 provided
a.cc:21:31: error: 'd' was not declared in this scope
   21 |         dp[i][j]=min(dp[i][j],d[i][k]+d[k][j]);
      |                               ^
a.cc:38:19: error: 'n' was not declared in this scope
   38 |     for(int i=0;i<n;i++){
      |                   ^