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

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<functional>
#include<utility>

using namespace std;
typedef pair<int, int> P;
vector<edge> G(100000);
const int INF = (1 << 29);
int V, E, r;
int dp[100000] = { INF };
struct edge{
	int to, cost;
	edge(int to,int cost=1):to(to),cost(cost){}
};


int main()
{
	 cin >> V >> E >> r;
	G.resize(V);
	for (int i = 0; i < E; ++i) {
		int s, t, d;
		cin >> s >> t >> d;
		edge e(t, d);
		G[s].push_back(e);
	}
	dp[r] = 0;
	priority_queue<P, vector<P>, greater<P>> que;
	P tmp(0, r);
	que.push(tmp);
	while (!que.empty()) {
		P p = que.top(); que.pop();
		if (dp[p.second] <= p.first)continue;

		for (int i = 0; i < G[p.first].size(); ++i) {
			if (dp[G[i].to]>dp[p.first] + G[i].cost) {
				dp[G[i].to] = dp[p.first] + G[i].cost;
				que.push(P(dp[G[i].to], G[i].to));
			}
		}
	}
	for (int i = 0; i < V; ++i) {
		cout << dp[i] << endl;
	}
}

Compiler output:
a.cc:10:8: error: 'edge' was not declared in this scope
   10 | vector<edge> G(100000);
      |        ^~~~
a.cc:10:12: error: template argument 1 is invalid
   10 | vector<edge> G(100000);
      |            ^
a.cc:10:12: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:23:11: error: request for member 'resize' in 'G', which is of non-class type 'int'
   23 |         G.resize(V);
      |           ^~~~~~
a.cc:28:18: error: invalid types 'int[int]' for array subscript
   28 |                 G[s].push_back(e);
      |                  ^
a.cc:38:38: error: invalid types 'int[int]' for array subscript
   38 |                 for (int i = 0; i < G[p.first].size(); ++i) {
      |                                      ^
a.cc:39:33: error: invalid types 'int[int]' for array subscript
   39 |                         if (dp[G[i].to]>dp[p.first] + G[i].cost) {
      |                                 ^
a.cc:39:56: error: invalid types 'int[int]' for array subscript
   39 |                         if (dp[G[i].to]>dp[p.first] + G[i].cost) {
      |                                                        ^
a.cc:40:37: error: invalid types 'int[int]' for array subscript
   40 |                                 dp[G[i].to] = dp[p.first] + G[i].cost;
      |                                     ^
a.cc:40:62: error: invalid types 'int[int]' for array subscript
   40 |                                 dp[G[i].to] = dp[p.first] + G[i].cost;
      |                                                              ^
a.cc:41:48: error: invalid types 'int[int]' for array subscript
   41 |                                 que.push(P(dp[G[i].to], G[i].to));
      |                                                ^
a.cc:41:58: error: invalid types 'int[int]' for array subscript
   41 |                                 que.push(P(dp[G[i].to], G[i].to));
      |                                                          ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<functional>
#include<utility>

using namespace std;
typedef pair<int, int> P;
const int INF = (1 << 29);
int V, E, r;
int dp[100000] = { INF };
struct edge{
	int to, cost;
	edge(int to,int cost=1):to(to),cost(cost){}
};
vector<edge> G[100000];



int main()
{
	 cin >> V >> E >> r;
	G.resize(V);
	for (int i = 0; i < E; ++i) {
		int s, t, d;
		cin >> s >> t >> d;
		edge e(t, d);
		G[s].push_back(e);
	}
	dp[r] = 0;
	priority_queue<P, vector<P>, greater<P>> que;
	P tmp(0, r);
	que.push(tmp);
	while (!que.empty()) {
		P p = que.top(); que.pop();
		if (dp[p.second] <= p.first)continue;

		for (int i = 0; i < G[p.first].size(); ++i) {
			if (dp[G[p.first][i].to]>dp[p.first] + G[p.first][i].cost) {
				dp[G[p.first][i].to] = dp[p.first] + G[p.first][i].cost;
				que.push(P(dp[G[p.first][i].to], G[p.first][i].to));
			}
		}
	}
	for (int i = 0; i < V; ++i) {
		cout << dp[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:11: error: request for member 'resize' in 'G', which is of non-class type 'std::vector<edge> [100000]'
   24 |         G.resize(V);
      |           ^~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<functional>
#include<utility>

using namespace std;
typedef pair<int, int> P;
const int INF = (1 << 30);
int V, E, r;
int dp[100000];
struct edge{
	int to, cost;
	edge(int to,int cost=1):to(to),cost(cost){}
};
vector<edge> G[100000];



int main()
{
	cin.tie(false);
	ios::ios_base::sync_with_stdio(false);
	 cin >> V >> E >> r;
	for (int i = 0; i < E; ++i) {
		int s, t, d;
		cin >> s >> t >> d;
		edge e(t,d);
		G[s].push_back(e);
	}
	fill(dp, dp + V, INF);
	dp[r] = 0;
	priority_queue<P, vector<P>, greater<P>> que;
	P start(0, r);
	que.push(start);
	while (!que.empty()) {
		P p = que.top(); que.pop();
		if (dp[p.second] < p.first)continue;

		int v = p.second;
		for (int i = 0; i < G[v].size(); i++) {
			edge e = G[v][i];
			if (dp[e.to]>dp[v] + e.cost) {
				dp[e.to] = dp[v] + e.cost;
				que.push(P(dp[e.to], e.to));
			}
		}
	}
	for (int i = 0; i < V; i++) {
		if (dp[i] == INF)cout << "INF\n";
		else cout << dp[i] << "\n";
	}
	cout << flush;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: no matching function for call to 'std::basic_istream<char>::tie(bool)'
   23 |         cin.tie(false);
      |         ~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_ios.h:299:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie() const [with _CharT = char; _Traits = std::char_traits<char>]'
  299 |       tie() const
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:299:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_ios.h:311:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie(std::basic_ostream<_CharT, _Traits>*) [with _CharT = char; _Traits = std::char_traits<char>]'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:311:43: note:   no known conversion for argument 1 from 'bool' to 'std::basic_ostream<char>*'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<functional>
#include<utility>

using namespace std;
typedef pair<int, int> P;
const int INF = (1 << 30);
int V, E, r;
int dp[100000];
struct edge{
	int to, cost;
	edge(int to,int cost=1):to(to),cost(cost){}
};
vector<edge> G[100000];



int main()
{
	cin.tie(false);
	ios::ios_base::sync_with_stdio(false);
	 cin >> V >> E >> r;
	for (int i = 0; i < E; ++i) {
		int s, t, d;
		cin >> s >> t >> d;
		edge e(t,d);
		G[s].emplace_back(e);
	}
	fill(dp, dp + V, INF);
	dp[r] = 0;
	priority_queue<P, vector<P>, greater<P>> que;
	P start(0, r);
	que.push(start);
	while (!que.empty()) {
		P p = que.top(); que.pop();
		if (dp[p.second] < p.first)continue;

		int v = p.second;
		for (int i = 0; i < G[v].size(); ++i) {
			edge e = G[v][i];
			if (dp[e.to]>dp[v] + e.cost) {
				dp[e.to] = dp[v] + e.cost;
				que.push(P(dp[e.to], e.to));
			}
		}
	}
	for (int i = 0; i < V; ++i) {
		if (dp[i] == INF)cout << "INF\n";
		else cout << dp[i] << "\n";
	}
	cout << flush;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: no matching function for call to 'std::basic_istream<char>::tie(bool)'
   23 |         cin.tie(false);
      |         ~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_ios.h:299:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie() const [with _CharT = char; _Traits = std::char_traits<char>]'
  299 |       tie() const
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:299:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_ios.h:311:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie(std::basic_ostream<_CharT, _Traits>*) [with _CharT = char; _Traits = std::char_traits<char>]'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:311:43: note:   no known conversion for argument 1 from 'bool' to 'std::basic_ostream<char>*'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include <vector>
#include <algorithm>
#include <queue>

struct Edge {
	int src, dst;
	Edge(int src = 0, int dst = 0) : src(src), dst(dst) {}
};

template <typename Cost>
struct WeightedEdge : Edge {
	Cost cost;
	WeightedEdge(int src, int dst, Cost cost) : Edge(src, dst), cost(cost) {}
	bool operator < (const WeightedEdge<Cost> &rhs) const {
		return cost > rhs.cost;
	}
};

template <class Edge>
class Graph {
public:
	Graph(){}
	Graph(int n) : graph_(n) {}
	int size() const {
		return graph_.size();
	}
	void addEdge(const Edge &e){
		graph_[e.src].push_back(e);
	}
	std::vector<Edge>& operator [] (int i){
		return graph_[i];
	}
	const std::vector<Edge>& operator [] (int i) const {
		return graph_[i];
	}
private:
	std::vector<std::vector<Edge> > graph_;
};


template <typename Cost>
class Dijkstra : Graph<WeightedEdge<Cost> >{
public:
	const Cost INF = 1e9;
	typedef WeightedEdge<Cost> EdgeType;
	typedef Graph<EdgeType> GraphType;
	using GraphType::size;
	using GraphType::addEdge;
	
	Dijkstra(){}
	Dijkstra(int n) : Graph<EdgeType>(n) {}
	void addEdge(int src, int dst, Cost cost){
		addEdge(EdgeType(src, dst, cost));
	}
	void solve(int s){
		int n = size();
		dist_.assign(size(), INF);
		prev_.assign(size(), -1);
		std::priority_queue<EdgeType> pq;
		dist_[s] = 0;
		pq.push(EdgeType(-1, s, 0));
		while (!pq.empty()){
			EdgeType c = pq.top(); pq.pop();
			if (dist_[c.dst] < c.cost) continue;
			prev_[c.dst] = c.src;
			for (int i = 0; i < (*this)[c.dst].size(); i++){
				EdgeType &e = (*this)[c.dst][i];
				if (dist_[e.dst] > c.cost + e.cost){
					dist_[e.dst] = c.cost + e.cost;
					pq.push(EdgeType(e.src, e.dst, c.cost + e.cost));
				}
			}
		}
	}
	Cost getDist(int t){
		return dist_[t];
	}
	std::vector<int> getPath(int t){
		std::vector<int> path;
		for (int v = t; v != -1; v = prev_[v]){
			path.push_back(v);
		}
		std::reverse(path.begin(), path.end());
		return path;
	}
private:
	std::vector<Cost> dist_;
	std::vector<int> prev_;
};


int main()
{
	int n, m, r;
	scanf("%d %d %d", &n, &m, &r);
	
	Dijkstra<int> dijkstra(n);
	
	for (int i = 0; i < m; i++){
		int s, t, d;
		scanf("%d %d %d", &s, &t, &d);
		dijkstra.addEdge(s, t, d);
	}
	
	dijkstra.solve(r);
	for (int i = 0; i < n; i++){
		int c = dijkstra.getDist(i);
		if (c == dijkstra.INF) puts("INF");
		else printf("%d\n", c);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:95:9: error: 'scanf' was not declared in this scope
   95 |         scanf("%d %d %d", &n, &m, &r);
      |         ^~~~~
a.cc:108:40: error: 'puts' was not declared in this scope
  108 |                 if (c == dijkstra.INF) puts("INF");
      |                                        ^~~~
a.cc:109:22: error: 'printf' was not declared in this scope
  109 |                 else printf("%d\n", c);
      |                      ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include <queue>
  +++ |+#include <cstdio>
    4 |
Language: C++

#include<iostream>
using namespace std;
#define N 100005
#define MAX 999999999

int mat[N][N];
int dist[N];
bool visited[N];

int minDistance(int);

int v =0;
int min1= INT_MAX;

void dijkstra(int V)
{
   
    //v = minDistance(V); 
    
    for(int j=0; j<V; j++)
    {
         min1 = INT_MAX;
       for (int i = 0; i < V; i++)
       {
         if (visited[i] == false && dist[i] <= min1)
         {
             min1 = dist[i];
             v = i;
         }
       }

        visited[v] = true;
        
        for(int i=0; i<V; i++)
        {
            if(mat[v][i] && visited[i]==false && dist[v] != MAX && dist[i] > dist[v] + mat[v][i])
            {
                dist[i] = dist[v] + mat[v][i];
            }
        }
    }
}

int minDistance(int V)
{
   // Initialize min value
   int min = INT_MAX, min_index;
 
   for (int v = 0; v < V; v++)
     if (visited[v] == false && dist[v] <= min)
         min = dist[v], min_index = v;
 
   return min_index;
}

int main()
{
    int V, E, r, s, t, d;
    

    cin>>V;
    cin>>E;
    cin>>r;
    for(int i=0; i<V; i++)
    {       
        visited[i] = false;
        dist[i] = MAX;
        for(int j=0; j<V; j++)
            mat[i][j] = 0;
    }

    for(int i=0; i<E; i++)
    {
        cin>>s;
        cin>>t;
        cin>>d;

        mat[s][t] = d;
        mat[t][s] = d;
    }

    
    dist[r] = 0;
    
    dijkstra(V);

    for(int i=0; i<V; i++)
    {
        if(dist[i] == MAX)
            cout<<"INF"<<endl;
        else
            cout<<dist[i]<<endl;
    }
    
    return 0;
}

Compiler output:
a.cc:13:11: error: 'INT_MAX' was not declared in this scope
   13 | int min1= INT_MAX;
      |           ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
a.cc: In function 'void dijkstra(int)':
a.cc:22:17: error: 'INT_MAX' was not declared in this scope
   22 |          min1 = INT_MAX;
      |                 ^~~~~~~
a.cc:22:17: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc: In function 'int minDistance(int)':
a.cc:47:14: error: 'INT_MAX' was not declared in this scope
   47 |    int min = INT_MAX, min_index;
      |              ^~~~~~~
a.cc:47:14: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc:51:25: error: 'min_index' was not declared in this scope
   51 |          min = dist[v], min_index = v;
      |                         ^~~~~~~~~
a.cc:53:11: error: 'min_index' was not declared in this scope
   53 |    return min_index;
      |           ^~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
#define N 1005
#define MAX 999999999

int mat[N][N];
int dist[N];
bool visited[N];

int minDistance(int);

int v =0;
int min1= INT_MAX;

void dijkstra(int V)
{
   
    //v = minDistance(V); 
    
    for(int j=0; j<V; j++)
    {
         min1 = INT_MAX;
       for (int i = 0; i < V; i++)
       {
         if (visited[i] == false && dist[i] <= min1)
         {
             min1 = dist[i];
             v = i;
         }
       }

        visited[v] = true;
        
        for(int i=0; i<V; i++)
        {
            if(mat[v][i] && visited[i]==false && dist[v] != MAX && dist[i] > dist[v] + mat[v][i])
            {
                dist[i] = dist[v] + mat[v][i];
            }
        }
    }
}

int minDistance(int V)
{
   // Initialize min value
   int min = INT_MAX, min_index;
 
   for (int v = 0; v < V; v++)
     if (visited[v] == false && dist[v] <= min)
         min = dist[v], min_index = v;
 
   return min_index;
}

int main()
{
    int V, E, r, s, t, d;
    

    cin>>V;
    cin>>E;
    cin>>r;
    for(int i=0; i<V; i++)
    {       
        visited[i] = false;
        dist[i] = MAX;
        for(int j=0; j<V; j++)
            mat[i][j] = 0;
    }

    for(int i=0; i<E; i++)
    {
        cin>>s;
        cin>>t;
        cin>>d;

        mat[s][t] = d;
        mat[t][s] = d;
    }

    
    dist[r] = 0;
    
    dijkstra(V);

    for(int i=0; i<V; i++)
    {
        if(dist[i] == MAX)
            cout<<"INF"<<endl;
        else
            cout<<dist[i]<<endl;
    }
    
    return 0;
}

Compiler output:
a.cc:13:11: error: 'INT_MAX' was not declared in this scope
   13 | int min1= INT_MAX;
      |           ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
a.cc: In function 'void dijkstra(int)':
a.cc:22:17: error: 'INT_MAX' was not declared in this scope
   22 |          min1 = INT_MAX;
      |                 ^~~~~~~
a.cc:22:17: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc: In function 'int minDistance(int)':
a.cc:47:14: error: 'INT_MAX' was not declared in this scope
   47 |    int min = INT_MAX, min_index;
      |              ^~~~~~~
a.cc:47:14: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc:51:25: error: 'min_index' was not declared in this scope
   51 |          min = dist[v], min_index = v;
      |                         ^~~~~~~~~
a.cc:53:11: error: 'min_index' was not declared in this scope
   53 |    return min_index;
      |           ^~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
#define N 100005
#define MAX 999999999

int mat[N][N];
int dist[N];
bool visited[N];

int minDistance(int);

int v =0;
int min1= MAX;

void dijkstra(int V)
{
   
    //v = minDistance(V); 
    
    for(int j=0; j<V; j++)
    {
         min1 = MAX;
       for (int i = 0; i < V; i++)
       {
         if (visited[i] == false && dist[i] <= min1)
         {
             min1 = dist[i];
             v = i;
         }
       }

        visited[v] = true;
        
        for(int i=0; i<V; i++)
        {
            if(mat[v][i] && visited[i]==false && dist[v] != MAX && dist[i] > dist[v] + mat[v][i])
            {
                dist[i] = dist[v] + mat[v][i];
            }
        }
    }
}

int minDistance(int V)
{
   // Initialize min value
   int min = INT_MAX, min_index;
 
   for (int v = 0; v < V; v++)
     if (visited[v] == false && dist[v] <= min)
         min = dist[v], min_index = v;
 
   return min_index;
}

int main()
{
    int V, E, r, s, t, d;
    

    cin>>V;
    cin>>E;
    cin>>r;
    for(int i=0; i<V; i++)
    {       
        visited[i] = false;
        dist[i] = MAX;
        for(int j=0; j<V; j++)
            mat[i][j] = 0;
    }

    for(int i=0; i<E; i++)
    {
        cin>>s;
        cin>>t;
        cin>>d;

        mat[s][t] = d;
        mat[t][s] = d;
    }

    
    dist[r] = 0;
    
    dijkstra(V);

    for(int i=0; i<V; i++)
    {
        if(dist[i] == MAX)
            cout<<"INF"<<endl;
        else
            cout<<dist[i]<<endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int minDistance(int)':
a.cc:47:14: error: 'INT_MAX' was not declared in this scope
   47 |    int min = INT_MAX, min_index;
      |              ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
a.cc:51:25: error: 'min_index' was not declared in this scope
   51 |          min = dist[v], min_index = v;
      |                         ^~~~~~~~~
a.cc:53:11: error: 'min_index' was not declared in this scope
   53 |    return min_index;
      |           ^~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
#define N 100005
#define MAX 999999999

int mat[N][N];
int dist[N];
bool visited[N];

int minDistance(int);

int v =0;
int min1= MAX;

void dijkstra(int V)
{
   
    //v = minDistance(V); 
    
    for(int j=0; j<V; j++)
    {
         min1 = MAX;
       for (int i = 0; i < V; i++)
       {
         if (visited[i] == false && dist[i] <= min1)
         {
             min1 = dist[i];
             v = i;
         }
       }

        visited[v] = true;
        
        for(int i=0; i<V; i++)
        {
            if(mat[v][i] && visited[i]==false && dist[v] != MAX && dist[i] > dist[v] + mat[v][i])
            {
                dist[i] = dist[v] + mat[v][i];
            }
        }
    }
}

int minDistance(int V)
{
   // Initialize min value
   int min = MAX, min_index;
 
   for (int v = 0; v < V; v++)
     if (visited[v] == false && dist[v] <= min)
         min = dist[v], min_index = v;
 
   return min_index;
}

int main()
{
    int V, E, r, s, t, d;
    

    cin>>V;
    cin>>E;
    cin>>r;
    for(int i=0; i<V; i++)
    {       
        visited[i] = false;
        dist[i] = MAX;
        for(int j=0; j<V; j++)
            mat[i][j] = 0;
    }

    for(int i=0; i<E; i++)
    {
        cin>>s;
        cin>>t;
        cin>>d;

        mat[s][t] = d;
        mat[t][s] = d;
    }

    
    dist[r] = 0;
    
    dijkstra(V);

    for(int i=0; i<V; i++)
    {
        if(dist[i] == MAX)
            cout<<"INF"<<endl;
        else
            cout<<dist[i]<<endl;
    }
    
    return 0;
}

Compiler output:
/tmp/ccVzX9Xx.o: in function `dijkstra(int)':
a.cc:(.text+0x2e): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccVzX9Xx.o
a.cc:(.text+0x4d): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccVzX9Xx.o
a.cc:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccVzX9Xx.o
a.cc:(.text+0x80): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccVzX9Xx.o
a.cc:(.text+0x92): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccVzX9Xx.o
a.cc:(.text+0x9b): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccVzX9Xx.o
a.cc:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccVzX9Xx.o
a.cc:(.text+0xe9): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccVzX9Xx.o
a.cc:(.text+0xfe): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccVzX9Xx.o
a.cc:(.text+0x10f): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccVzX9Xx.o
a.cc:(.text+0x131): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
#define N 100005
#define MAX 999999999

int mat[N][N];
int dist[N];
bool visited[N];

int minDistance(int);

int v =0;
int min1= MAX;

void dijkstra(int V)
{
   
    //v = minDistance(V); 
    
    for(int j=0; j<V; j++)
    {
         min1 = MAX;
       for (int i = 0; i < V; i++)
       {
         if (visited[i] == false && dist[i] <= min1)
         {
             min1 = dist[i];
             v = i;
         }
       }

        visited[v] = true;
        
        for(int i=0; i<V; i++)
        {
            if(mat[v][i]!=-1 && visited[i]==false && dist[v] != MAX && dist[i] > dist[v] + mat[v][i])
            {
                dist[i] = dist[v] + mat[v][i];
            }
        }
    }
}

int minDistance(int V)
{
   // Initialize min value
   int min = MAX, min_index;
 
   for (int v = 0; v < V; v++)
     if (visited[v] == false && dist[v] <= min)
         min = dist[v], min_index = v;
 
   return min_index;
}

int main()
{
    int V, E, r, s, t, d;
    

    cin>>V;
    cin>>E;
    cin>>r;
    for(int i=0; i<V; i++)
    {       
        visited[i] = false;
        dist[i] = MAX;
        for(int j=0; j<V; j++)
            mat[i][j] = -1;
    }

    for(int i=0; i<E; i++)
    {
        cin>>s;
        cin>>t;
        cin>>d;

        mat[s][t] = d;
       // mat[t][s] = d;
    }

    
    dist[r] = 0;
    
    dijkstra(V);

    for(int i=0; i<V; i++)
    {
        if(dist[i] == MAX)
            cout<<"INF"<<endl;
        else
            cout<<dist[i]<<endl;
    }
    
    return 0;
}

Compiler output:
/tmp/ccYScY0v.o: in function `dijkstra(int)':
a.cc:(.text+0x2e): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccYScY0v.o
a.cc:(.text+0x4d): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccYScY0v.o
a.cc:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccYScY0v.o
a.cc:(.text+0x80): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccYScY0v.o
a.cc:(.text+0x92): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccYScY0v.o
a.cc:(.text+0x9b): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccYScY0v.o
a.cc:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccYScY0v.o
a.cc:(.text+0xea): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccYScY0v.o
a.cc:(.text+0xff): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccYScY0v.o
a.cc:(.text+0x110): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccYScY0v.o
a.cc:(.text+0x132): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>

 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(int i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(int i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007
 

const int MAX_V = 10000;


struct edge{ int to, cost; };


int V;
vector<edge> G[MAX_V];
int d[MAX_V];


void dijkstra(int s){
	//greater<pii>????????????????????¨??§first????°???????????????????????????????????????????
	priority_queue<pii, vector<pii>, greater<pii> > que;
	fill(d, d + V, INF);
	d[s] = 0;
	que.push(pii(0, s));

	while(!que.empty()){
		pii p = que.top();
		que.pop();
		int v = p.second;
		if(d[v] < p.first) continue;
		for(int i = 0; i < G[v].size(); i++){
			edge e = G[v][i];
			if(d[e.to] > d[v] + e.cost){
				d[e.to] = d[v] + e.cost;
				que.push(pii(d[e.to],e.to));
			}
		}
	}
}



int main(){
	int E, r;
	cin>>V>>E>>r;
	int s,e,cost;
	rep(i, E){
		cin>>s>>e>>cost;
		G[s].pb(edge(e,cost));
	}
	dijkstra(r);
	rep(i, V) {
		if(d[i] == INF) cout<<"INF"<<endl;
		else cout<<d[i]<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:85:36: error: no matching function for call to 'edge::edge(int&, int&)'
   85 |                 G[s].pb(edge(e,cost));
      |                                    ^
a.cc:18:27: note: in definition of macro 'pb'
   18 | #define pb(n)   push_back(n)
      |                           ^
a.cc:47:8: note: candidate: 'edge::edge()'
   47 | struct edge{ int to, cost; };
      |        ^~~~
a.cc:47:8: note:   candidate expects 0 arguments, 2 provided
a.cc:47:8: note: candidate: 'constexpr edge::edge(const edge&)'
a.cc:47:8: note:   candidate expects 1 argument, 2 provided
a.cc:47:8: note: candidate: 'constexpr edge::edge(edge&&)'
a.cc:47:8: note:   candidate expects 1 argument, 2 provided
Language: C++

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

#define INF (INT_MAX/2) 
#define MAX_E 500000
#define MAX_V 100000

struct edge{
  int from, to, cost; 
  edge(){}
  edge(int f, int t, int c){
    from = f;
    to = t;
    cost = c;
  }
};
edge es[MAX_E];

int dist[MAX_V];
int previous[MAX_V];
int V, E, r;

bool bellman_ford(int s){
  for(int i = 0; i < V; i++) dist[i] = INF;
  dist[s] = 0;
  previous[s] = -1;

  for(int i = 0; i < V; i++){
    for(int j = 0; j < E; j++){
      edge e = es[j];
      if(dist[e.to] > dist[e.from] + e.cost){
        dist[e.to] = dist[e.from] + e.cost;
        previous[e.to] = e.from; 
        if(i == V - 1) return true;
      }
    }
  }

  return false;
}

vector<int> get_path(int t){
  vector<int> path;
  for(; t != -1; t = previous[t]) path.push_back(t);
  reverse(path.begin(), path.end());
  return path;
}

int main(void){
  cin >> V >> E >> r;
  for(int i = 0; i < E; i++){
    int s, t, d;
    cin >> s >> t >> d;
    es[i] = edge(s, t, d);
  }
  bellman_ford(r);
  for(int i = 0; i < V; i++){
    if(dist[i] == INF) cout << "INF" << endl;
    else cout << dist[i] << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool bellman_ford(int)':
a.cc:6:14: error: 'INT_MAX' was not declared in this scope
    6 | #define INF (INT_MAX/2)
      |              ^~~~~~~
a.cc:26:40: note: in expansion of macro 'INF'
   26 |   for(int i = 0; i < V; i++) dist[i] = INF;
      |                                        ^~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 | using namespace std;
a.cc: In function 'int main()':
a.cc:6:14: error: 'INT_MAX' was not declared in this scope
    6 | #define INF (INT_MAX/2)
      |              ^~~~~~~
a.cc:60:19: note: in expansion of macro 'INF'
   60 |     if(dist[i] == INF) cout << "INF" << endl;
      |                   ^~~
a.cc:6:14: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #define INF (INT_MAX/2)
      |              ^~~~~~~
a.cc:60:19: note: in expansion of macro 'INF'
   60 |     if(dist[i] == INF) cout << "INF" << endl;
      |                   ^~~
Language: C++

// ?????????single source shortest path
// Bellman-Ford
#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <set>
#include <deque>
#include <vector>
#define INF 100100100
#define BIG 100000
#define rep(i,p) for(int i=0;i<p;i++)
#define rep1(i,p) for(int i=1;i<=p;i++)
#define pb push_back
using namespace std;
int V,E,r,s,t,a;
int w[BIG][BIG];
int d[BIG];
int main(){
  // init
  rep(i,BIG) 
    rep(k,BIG) {
      if (i != k) w[i][k] = INF;
      else w[i][k] = 0;
    }
  rep(i,BIG) d[i] = INF;
  // r is source of graph
  cin >> V >> E >> r;
  rep(i,E) {
    cin >> s >> t >> a;
    w[s][t] = a;
  }
  d[r] = 0;
  rep(i,V) 
    rep(j,V) {
      d[j] = min(d[j],d[i]+w[i][j]);
  }
  rep(i,V) {
    if (d[i] == INF) cout << "INF" << endl;
    else cout << d[i] << endl;
  }
  return 0;
}

Compiler output:
/tmp/cceYsG6N.o: in function `main':
a.cc:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cceYsG6N.o
a.cc:(.text+0x1b2): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cceYsG6N.o
a.cc:(.text+0x1e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cceYsG6N.o
a.cc:(.text+0x228): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cceYsG6N.o
a.cc:(.text+0x251): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cceYsG6N.o
a.cc:(.text+0x29a): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cceYsG6N.o
a.cc:(.text+0x2e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cceYsG6N.o
collect2: error: ld returned 1 exit status
Language: C++

// ?????????single source shortest path
// Bellman-Ford
#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <set>
#include <deque>
#include <vector>
#define INF 100100100
#define BIG 100000
#define rep(i,p) for(int i=0;i<p;i++)
#define rep1(i,p) for(int i=1;i<=p;i++)
#define pb push_back
using namespace std;
int V,E,r,s,t,a;
int w[BIG][BIG];
int d[BIG];
int main(){
  // init
  rep(i,BIG) 
    rep(k,BIG) {
      if (i != k) w[i][k] = INF;
      else w[i][k] = 0;
    }
  rep(i,BIG) d[i] = INF;
  // r is source of graph
  cin >> V >> E >> r;
  rep(i,E) {
    cin >> s >> t >> a;
    w[s][t] = a;
  }
  d[r] = 0;
  rep(i,V) 
    rep(j,V) {
      d[j] = min(d[j],d[i]+w[i][j]);
  }
  rep(i,V) {
    if (d[i] == INF) cout << "INF" << endl;
    else cout << d[i] << endl;
  }
  return 0;
}

Compiler output:
/tmp/ccYPOBHI.o: in function `main':
a.cc:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccYPOBHI.o
a.cc:(.text+0x1b2): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccYPOBHI.o
a.cc:(.text+0x1e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccYPOBHI.o
a.cc:(.text+0x228): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccYPOBHI.o
a.cc:(.text+0x251): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccYPOBHI.o
a.cc:(.text+0x29a): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccYPOBHI.o
a.cc:(.text+0x2e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccYPOBHI.o
collect2: error: ld returned 1 exit status
Language: C++

// ?????????single source shortest path
// Bellman-Ford
#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <set>
#include <deque>
#include <vector>
#define INF 100100100
#define BIG 100000
#define rep(i,p) for(int i=0;i<p;i++)
#define rep1(i,p) for(int i=1;i<=p;i++)
#define pb push_back
using namespace std;
int V,E,r,s,t,a;
int w[BIG][BIG];
int d[BIG];
int main(){
  // init
  rep(i,BIG) 
    rep(k,BIG) {
      if (i != k) w[i][k] = INF;
      else w[i][k] = 0;
    }
  rep(i,BIG) d[i] = INF;
  // r is source of graph
  cin >> V >> E >> r;
  rep(i,E) {
    cin >> s >> t >> a;
    w[s][t] = a;
  }
  d[r] = 0;
  rep(i,V) 
    rep(j,V) {
      d[j] = min(d[j],d[i]+w[i][j]);
  }
  rep(i,V) {
    if (d[i] == INF) cout << "INF" << endl;
    else cout << d[i] << endl;
  }
  return 0;
}

Compiler output:
/tmp/ccda3x0b.o: in function `main':
a.cc:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccda3x0b.o
a.cc:(.text+0x1b2): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccda3x0b.o
a.cc:(.text+0x1e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccda3x0b.o
a.cc:(.text+0x228): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccda3x0b.o
a.cc:(.text+0x251): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccda3x0b.o
a.cc:(.text+0x29a): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccda3x0b.o
a.cc:(.text+0x2e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccda3x0b.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#define INF 100100100
#define BIG 100000
#define rep(i,p) for(int i=0;i<p;i++)
#define rep1(i,p) for(int i=1;i<=p;i++)
#define pb push_back
using namespace std;
int V,E,r,s,t,a;
int w[BIG][BIG];
int d[BIG];
int main(){
  // init
  rep(i,BIG) 
    rep(k,BIG) {
      if (i != k) w[i][k] = INF;
      else w[i][k] = 0;
    }
  rep(i,BIG) d[i] = INF;
  // r is source of graph
  cin >> V >> E >> r;
  rep(i,E) {
    cin >> s >> t >> a;
    w[s][t] = a;
  }
  d[r] = 0;
  rep(i,V) 
    rep(j,V) {
      d[j] = min(d[j],d[i]+w[i][j]);
  }
  rep(i,V) {
    if (d[i] == INF) cout << "INF" << endl;
    else cout << d[i] << endl;
  }
  return 0;
}

Compiler output:
/tmp/ccod9Oqb.o: in function `main':
a.cc:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccod9Oqb.o
a.cc:(.text+0x1b2): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccod9Oqb.o
a.cc:(.text+0x1e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccod9Oqb.o
a.cc:(.text+0x228): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccod9Oqb.o
a.cc:(.text+0x251): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccod9Oqb.o
a.cc:(.text+0x29a): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccod9Oqb.o
a.cc:(.text+0x2e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccod9Oqb.o
collect2: error: ld returned 1 exit status
Language: C++

// ?????????single source shortest path
// Bellman-Ford
#include <iostream>
#define INF 100100100
#define BIG 100000
#define rep(i,p) for(int i=0;i<p;i++)
#define rep1(i,p) for(int i=1;i<=p;i++)
#define pb push_back
using namespace std;
int V,E,r,s,t,a;
int w[BIG][BIG];
int d[BIG];
int main(){
  // init
  rep(i,BIG) 
    rep(k,BIG) {
      if (i != k) w[i][k] = INF;
      else w[i][k] = 0;
    }
  rep(i,BIG) d[i] = INF;
  // r is source of graph
  cin >> V >> E >> r;
  rep(i,E) {
    cin >> s >> t >> a;
    w[s][t] = a;
  }
  d[r] = 0;
  rep(i,V) 
    rep(j,V) {
      d[j] = min(d[j],d[i]+w[i][j]);
  }
  rep(i,V) {
    if (d[i] == INF) cout << "INF" << endl;
    else cout << d[i] << endl;
  }
  return 0;
}

Compiler output:
/tmp/cc1ExeGg.o: in function `main':
a.cc:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc1ExeGg.o
a.cc:(.text+0x1b2): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc1ExeGg.o
a.cc:(.text+0x1e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc1ExeGg.o
a.cc:(.text+0x228): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc1ExeGg.o
a.cc:(.text+0x251): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc1ExeGg.o
a.cc:(.text+0x29a): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc1ExeGg.o
a.cc:(.text+0x2e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc1ExeGg.o
collect2: error: ld returned 1 exit status
Language: C++

// ?????????single source shortest path
// Bellman-Ford
#include <iostream>
#define INF 100100100
#define BIG 100000
#define rep(i,p) for(int i=0;i<p;i++)
#define rep1(i,p) for(int i=1;i<=p;i++)
#define pb push_back
using namespace std;
int V,E,r,s,t,a;
int w[BIG][BIG];
int d[BIG];
int main(){
  // init
  rep(i,BIG) 
    rep(k,BIG) {
      if (i != k) w[i][k] = INF;
      else w[i][k] = 0;
    }
  rep(i,BIG) d[i] = INF;
  // r is source of graph
  cin >> V >> E >> r;
  rep(i,E) {
    cin >> s >> t >> a;
    w[s][t] = a;
  }
  d[r] = 0;
  rep(i,V) 
    rep(j,V) {
      d[i] = min(d[i],d[j]+w[j][i]);
  }
  rep(i,V) {
    if (d[i] == INF) cout << "INF" << endl;
    else cout << d[i] << endl;
  }
  return 0;
}

Compiler output:
/tmp/cc2IS5p5.o: in function `main':
a.cc:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc2IS5p5.o
a.cc:(.text+0x1b2): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc2IS5p5.o
a.cc:(.text+0x1e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc2IS5p5.o
a.cc:(.text+0x228): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc2IS5p5.o
a.cc:(.text+0x251): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc2IS5p5.o
a.cc:(.text+0x29a): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc2IS5p5.o
a.cc:(.text+0x2e5): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc2IS5p5.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;
const int inf = 10000 * 10000 + 100;

int main(){
	int V, E, r;
	cin >> n >> m >> r;
	vector<int> cost(V, inf);
	cost[r] = 0;
	vector<int> s(E);
	vector<int> t(E);
	vector<int> d(E);
	for(int i = 0; i < E; i++){
		cin >> s[i] >> t[i] >> d[i];
	}
	
	for(int i = 0; i < V; i++){
		bool update = false;
		for(int j = 0; j < E; j++){
			if(cost[s[j]] < inf && cost[s[j]] + d[j] < cost[t[j]]){
				cost[t[j]] = cost[s[j]] + d[j];
				update = true;
			}
		}
		if (!update) break;
	}
	for(int i = 0; i < V; i++){
		if(cost[i] > inf)
			cout << cost[i] << endl;
		else
			cout << "INF" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 'n' was not declared in this scope
   10 |         cin >> n >> m >> r;
      |                ^
a.cc:10:21: error: 'm' was not declared in this scope
   10 |         cin >> n >> m >> r;
      |                     ^
Language: C++

#include<stdio.h>
#include<vector>
#include<queue>
#include<algorithm>
#define INF 1000000000
using namespace std;
typedef pair<int,int> P;
struct edge{
    int to,cost;
};
int d[100000];
vector<edge> G[100000];
int dijkstra(){
    int v,e,r;
    scanf("%d %d %d",&v,&e,&r);
    for(int i=0;i<e;i++){
        int s,t,d;
        scanf("%d %d %d",&s,&t,&d);
        edge e;
        e.to=t; e.cost=d;
        G[s].push_back(e);
    }
    priority_queue<P,vector<P>,greater<P> > q;
    fill(d,d+v,INF);
    d[r]=0;
    q.push(P(0,r));
    while(!q.empty()){
        P p=q.top(); q.pop();
        int x=p.second;
        if(d[x]<p.first) continue;
        for(int i=0;i<G[x].size;i++){
            edge e=G[x][i];
            if(d[e.to]>e.cost+d[x]){
                d[e.to]=e.cost+d[x];
                q.push(d[e.to],e.to);
            }
        }
    }
    for(int i=0;i<v;i++){
        if(d[e.to]==INF) printf("INF\n");
        else printf("%d\n",d[e.to]);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int dijkstra()':
a.cc:31:28: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = edge; _Alloc = std::allocator<edge>; size_type = long unsigned int]' (did you forget the '()' ?)
   31 |         for(int i=0;i<G[x].size;i++){
      |                       ~~~~~^~~~
      |                                ()
a.cc:35:23: error: no matching function for call to 'std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> > >::push(int&, int&)'
   35 |                 q.push(d[e.to],e.to);
      |                 ~~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int> >; _Compare = std::greater<std::pair<int, int> >; value_type = std::pair<int, int>]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int> >; _Compare = std::greater<std::pair<int, int> >; value_type = std::pair<int, int>]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note:   candidate expects 1 argument, 2 provided
a.cc:40:16: error: request for member 'to' in 'e', which is of non-class type 'int'
   40 |         if(d[e.to]==INF) printf("INF\n");
      |                ^~
a.cc:41:32: error: request for member 'to' in 'e', which is of non-class type 'int'
   41 |         else printf("%d\n",d[e.to]);
      |                                ^~
Language: C++

#include <iostream>
#include <array>
#include <algorithm>

typedef struct {
    int point1;
    int point2;
    int cost;
} way;

int main()
{
    int number_point, number_edge;
    int start_point;
    std::cin >> number_point >> number_edge >> start_point;//?????????????????°??¨?§???????????????????

    //?§????????????????????????????
    const int MAXPOINT = 100000;
    const int BIGNUMBER = 999999;
    std::array<int, MAXPOINT> shortest_way;

    for (int i = 0; i < MAXPOINT; i++) {
        shortest_way.at(i) = BIGNUMBER;//??§???????????§?????????
    }
    shortest_way.at(start_point) = 0;//???????????´??????????§????????????????0

    //?§?????????????????´?????????????????????£???????????????????????????
    std::array<way, 500000> way_data;
    for (int i = 0; i < number_edge; i++) {
        std::cin >> (way_data.at(i)).point1 >> (way_data.at(i)).point2 >> (way_data.at(i)).cost;
    }
   
   //????????????????°?????????´??°??????
    for (int kaisu = 0; kaisu < number_point; kaisu++) {
        for (way one : way_data) {
            //?????????point1????????±????????????????????£??????????????±??????
            shortest_way.at(one.point2) = std::min(shortest_way.at(one.point2), shortest_way.at(one.point1) + one.cost);            
        }
    }
    
    for(int i = 0; i < number_point; i++) {
        if (shortest_way.at(i) == BUGNUMBER) {
            std::cout << "INF" << std::endl;
        } else {
            std::cout << shortest_way.at(i) << std::endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:35: error: 'BUGNUMBER' was not declared in this scope; did you mean 'BIGNUMBER'?
   42 |         if (shortest_way.at(i) == BUGNUMBER) {
      |                                   ^~~~~~~~~
      |                                   BIGNUMBER
Language: C++

#define _CRT_SECURE_NO_WARNINGS
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(c) begin(c), end(c)
#define range(i,a,b) for(int i = a; i < (int)(b); i++)
#define rep(i,b) range(i,0,b)
#define eb emplace_back
typedef long long ll;
#define int ll
auto const inf = numeric_limits<int>::max()/4;
 
using Weight = int;
using Capacity = int;
struct Edge {
    int src, dst; Weight weight;
    Edge(int s, int d, int w) : src(s), dst(d), weight(w) {}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;
using Array = vector<Weight>;
using Matrix = vector<Array>;
 
pair<vector<Weight>, bool> spfa(const Graph &g, int s){
    const Weight inf = numeric_limits<Weight>::max()/4;
    const int n = g.size(); priority_queue<int> q;
    vector<Weight> dist(n, inf); vector<int> inQ(n);
    vector<int> count(n);
    dist[s] = 0; q.emplace(s); inQ[s] = true; ++count[s];
    bool negCycle = false;
    for(int i = 0; q.size(); i++){
        int v = q.top(); q.pop(); inQ[v] = false;
        for(auto &e : g[v]){
            if(dist[v] != inf && dist[e.dst] > dist[v] + e.weight){
                dist[e.dst] = dist[v] + e.weight;
                if(!inQ[e.dst]){
                    q.emplace(e.dst); inQ[e.dst] = true; ++count[e.dst];
                    if(count[e.dst] >= n){ negCycle = true; goto END; }
                }
            }
        }
    }
 END:;
    return make_pair(dist, !negCycle);
}
 
int main(){
    int V,E,r;
    while(cin >> V >> E >> r){
        Graph g(V);
        rep(i,E){
            int a,b,c;
            cin >> a >> b >> c;
            g[a].eb(a,b,c);
        }
        bool ok;
        vector<Weight> dist;
        tie(dist, ok) = spfa(g,r);
        if(ok){
            for(int i = 0; i < (int)dist.size(); i++){
                if(dist[i] == inf) cout << "INF";
                else cout << dist[i];
                cout << endl;
            }
        } else {
            cout << "NEGATIVE CYCLE" << endl;
        }
    }
}

Compiler output:
a.cc:10:13: error: '::main' must return 'int'
   10 | #define int ll
      |             ^~
a.cc:47:1: note: in expansion of macro 'int'
   47 | int main(){
      | ^~~