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

#include <iostream>  
using namespace std;  

const long MAX = 500000;
const long LEN = 100000;
  
long long map[LEN][LEN]; 
  
int dist[LEN];            
  
int mark[LEN];  
  

  
void init(){  
  
       int i,j;  
  
       for(i=0;i<LEN;i++){  
  
              for(j=0;j<LEN;j++){  
  
                     map[i][j]=MAX;  
  
              }  
  
       }  
  
         
  
}  
  

  
void myDijstra(int n,int start){  
  
       int i,j,min,k;  
  
       for(i=0;i<n;i++){  
  
              mark[i]=0;
  
              dist[i]=map[start][i]; 
  
                
  
       }  
  
       mark[start]=1; 
  
       dist[start]=0;  
  
       for(i=0;i<n;i++){  
  
              min=MAX;  
  
              for(j=0;j<n;j++){  
  
                     if(!mark[j] && dist[j]<min){    
  
                            min=dist[j];  
  
                            k=j;
  
                     }  
  
              }  
  
              if(min==MAX)  
  
                     break;  
  
              mark[k]=1;

  
       }  
  
}  
  
   
  
int main(){  
  
       int i,j,n,line,source;  
  
       int a,b,d;  
  
       cin>>n>>line>>source;   
  
       init();  
  
       for(i=0;i<line;i++){  
  
              cin>>a>>b>>d; 
  
              if(map[a][b]>d){  
  
                     map[a][b]=d;  
  
              }  
  
       }  
  
       myDijstra(n,source);
  
  
       for (i=0;i<n;i++) {
		if(dist[i] == MAX){
			cout<<"INF"<<endl;
		}else{
			cout<<dist[i]<<endl;
		}
	
} 
  
       return 0;  
  
}  

Compiler output:
/tmp/ccz1KLYA.o: in function `myDijstra(int, int)':
a.cc:(.text+0x83): relocation truncated to fit: R_X86_64_PC32 against symbol `mark' defined in .bss section in /tmp/ccz1KLYA.o
a.cc:(.text+0xc8): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccz1KLYA.o
a.cc:(.text+0xeb): relocation truncated to fit: R_X86_64_PC32 against symbol `mark' defined in .bss section in /tmp/ccz1KLYA.o
a.cc:(.text+0x106): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccz1KLYA.o
a.cc:(.text+0x13d): relocation truncated to fit: R_X86_64_PC32 against symbol `mark' defined in .bss section in /tmp/ccz1KLYA.o
a.cc:(.text+0x158): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccz1KLYA.o
a.cc:(.text+0x174): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccz1KLYA.o
a.cc:(.text+0x1a9): relocation truncated to fit: R_X86_64_PC32 against symbol `mark' defined in .bss section in /tmp/ccz1KLYA.o
/tmp/ccz1KLYA.o: in function `main':
a.cc:(.text+0x2f2): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccz1KLYA.o
a.cc:(.text+0x33d): relocation truncated to fit: R_X86_64_PC32 against symbol `dist' defined in .bss section in /tmp/ccz1KLYA.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
#define P pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<28
#define mk make_pair
using namespace std;
int main(){
  int n,m,t;
  cin>>n>>m>>t;
  vector<pair<int,int> >a[n];
  rep(i,m){
    int q,w,e;
    cin>>q>>w>>e;
    a[q].push_back(mk(w,e));
  }
    priority_queue<P,vector<P>,greater<P> >q;
    int d[n];
    fill(d,d+n,INF);
    q.push(mk(0,t));
    d[t]=0;
    while(!q.empty()){
      P p=q.top();q.pop();
      int v=p.second;
      if(d[v]<p.first)continue;
      for(int i=0;i<a[v].size();i++){
        P ed=a[v][i];
        if(d[ed.first]>d[v]+ed.second){
          d[ed.first]=d[v]+ed.second;
          q.push(mk(d[ed.first],ed.first));
        }
      }
    }
  rep(i,n)cout<<(d[i]==INF)?"INF":d[i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:39: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   33 |   rep(i,n)cout<<(d[i]==INF)?"INF":d[i]<<endl;
      |                                   ~~~~^~~~~~
Language: C++

#include<bits/stdc++.h>
#define P pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<28
#define mk make_pair
using namespace std;
int main(){
  int n,m,t;
  cin>>n>>m>>t;
  vector<pair<int,int> >a[n];
  rep(i,m){
    int q,w,e;
    cin>>q>>w>>e;
    a[q].push_back(mk(w,e));
  }
    priority_queue<P,vector<P>,greater<P> >q;
    int d[n];
    fill(d,d+n,INF);
    q.push(mk(0,t));
    d[t]=0;
    while(!q.empty()){
      P p=q.top();q.pop();
      int v=p.second;
      if(d[v]<p.first)continue;
      for(int i=0;i<a[v].size();i++){
        P ed=a[v][i];
        if(d[ed.first]>d[v]+ed.second){
          d[ed.first]=d[v]+ed.second;
          q.push(mk(d[ed.first],ed.first));
        }
      }
    }
  rep(i,n)cout<<((d[i]==INF)?"INF":d[i])<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:29: error: operands to '?:' have different types 'const char*' and 'int'
   33 |   rep(i,n)cout<<((d[i]==INF)?"INF":d[i])<<endl;
      |                  ~~~~~~~~~~~^~~~~~~~~~~
Language: C++


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, j) for(int i = 0; i < (int)(j); i++)
constexpr int INF = 1 << 28;
constexpr ll INFL = 1LL << 60;
struct State{
    int index;
    ll cost;
    State(int i, ll c):index(i), cost(c) {}
    bool operator > (const State &r) const { return cost < r.cost; }
};
//
//
vector<ll> dijkstra(const EdgeList &G, int start) {
    priority_queue<State, vector<State>, greater<State>> que;
    vector<ll> dist(G.size(), INFL);
    que.emplace(start, 0);
    dist[start] = 0;
    while(not que.empty()){
        State now = que.top(); que.pop();
        for(Edge e : G[now.index]){
            if(dist[e.to] > now.cost + e.cost){
                State nxt = State(e.to, now.cost + e.cost);
                dist[e.to] = nxt.cost;                
                que.push(nxt);
            }
        }
    }
    return dist;
}
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A&lang=jp
int main() {
    int N, M, R; cin >> N >> M >> R;
    EdgeList E(N);
    rep(i, M) {
        int a, b, c; cin >> a >> b >> c;
        E[a].push_back(Edge(b, c));
        E[b].push_back(Edge(a, c));
    }
    auto dist = dijkstra(E, R);
    for(ll d : dist) cout << (d < INFL ? to_string(d) : "INF") << endl;
    return 0;
}

Compiler output:
a.cc:16:27: error: 'EdgeList' does not name a type
   16 | vector<ll> dijkstra(const EdgeList &G, int start) {
      |                           ^~~~~~~~
a.cc: In function 'std::vector<long long int> dijkstra(const int&, int)':
a.cc:18:23: error: request for member 'size' in 'G', which is of non-class type 'const int'
   18 |     vector<ll> dist(G.size(), INFL);
      |                       ^~~~
a.cc:23:13: error: 'Edge' was not declared in this scope
   23 |         for(Edge e : G[now.index]){
      |             ^~~~
a.cc:30:5: error: expected primary-expression before '}' token
   30 |     }
      |     ^
a.cc:29:10: error: expected ';' before '}' token
   29 |         }
      |          ^
      |          ;
   30 |     }
      |     ~     
a.cc:30:5: error: expected primary-expression before '}' token
   30 |     }
      |     ^
a.cc:29:10: error: expected ')' before '}' token
   29 |         }
      |          ^
      |          )
   30 |     }
      |     ~     
a.cc:23:12: note: to match this '('
   23 |         for(Edge e : G[now.index]){
      |            ^
a.cc:30:5: error: expected primary-expression before '}' token
   30 |     }
      |     ^
a.cc: In function 'int main()':
a.cc:36:5: error: 'EdgeList' was not declared in this scope
   36 |     EdgeList E(N);
      |     ^~~~~~~~
a.cc:39:9: error: 'E' was not declared in this scope
   39 |         E[a].push_back(Edge(b, c));
      |         ^
a.cc:39:24: error: 'Edge' was not declared in this scope
   39 |         E[a].push_back(Edge(b, c));
      |                        ^~~~
a.cc:42:26: error: 'E' was not declared in this scope
   42 |     auto dist = dijkstra(E, R);
      |                          ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

constexpr long long INF64 = 1e18;

using Weight=long long;

struct Edge{
    int src,dst;
    Weight weight;
    Edge(int src,int dst,Weight weight):
    src(src),dst(dst),weight(weight){}
};

auto operator < (const Edge &e,const Edge &f){
    if(e.weight!=f.weight)return e.weight>f.weight;
    else if(e.src!=f.src)return e.src<f.src;
    else return e.dst<f.dst;
}

using Edges=vector<Edge>;
using Graph=vector<Edges>;
//??????????????????
void dijkstra(const Graph &g,int s,vector<Weight>&dist,vector<int>&prev){
    const int V=g.size();
    priority_queue<Edge>q;
    dist[s]=0;
    for(q.emplace(-2,s,0);!q.empty();){
        Edge e=q.top();q.pop();
        if(prev[e.dst]!=-1)continue;
        prev[e.dst]=e.src;
        if(prev[t]!=-1)return dist[t];
        for(auto ge:g[e.dst]){
            if(dist[ge.dst] > e.weight+ge.weight){
                dist[ge.dst]=e.weight+ge.weight;
                q.emplace(ge.src,ge.dst,e.weight+ge.weight);
            }
        }
    }
}

int main(){
    cin.sync_with_stdio(false);
    int V,E,r;
    cin>>V>>E>>r;
    Graph g(V);
    for(int i=0;i<E;++i){
        int s,t,d;
        cin>>s>>t>>d;
        g[s].emplace_back(s,t,d);
    }
    vector<Weight>dist(V,INF64);//???????????§????????¢?????\???
    vector<int>prev(V,-1);//????????????????????\???
    dijkstra(g,r,dist,prev);
    for(int i=0;i<V;++i){
        if (dist[i] == INF64)cout << "INF" << endl;
        else cout << dist[i] << endl;
    }
}
//be checked by AOJ(GRL-1-A).

Compiler output:
a.cc: In function 'void dijkstra(const Graph&, int, std::vector<long long int>&, std::vector<int>&)':
a.cc:33:17: error: 't' was not declared in this scope
   33 |         if(prev[t]!=-1)return dist[t];
      |                 ^
Language: C++

#include <bits/stdc++.h>
#define MAXV 100000
const int INF = INT_MAX;
using namespace std;
typedef pair<int, int> P;
struct edge {int to, cost; };

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

void dijkstra(int s) {
  priority_queue<P, vector<P>, greater<P>> que;
  fill_n(d, V, INF);
  d[s] = 0;
  que.push(P(0, s));

  while(!que.empty()) {
    P 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(P(d[e.to], e.to));
      }
    }
  }
}

int main() {
  int E, r;
  cin >> V >> E >> r;
  for(int i = 0; i < E; i++) {
    int s, t, d;
    cin >> s >> t >> d;
    struct edge tmp;
    tmp.to = t; tmp.cost = d;
    G[s].push_back(tmp);
  }
  dijkstra(r);
  for(int i = 0; i < V; i++) {
    if(d[i] == INF){
      cout << "INF" << endl;
      continue;
    }
    cout << d[i] << endl;
  }

  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:51:12: error: expected '}' at end of input
   51 |   return 0;
      |            ^
a.cc:32:12: note: to match this '{'
   32 | int main() {
      |            ^
Language: C++

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

struct edge {
  edge () {}
  edge (int to, int cost) : to(to), cost(cost) {}

  int to, cost;
};

vector<long long> Dijkstra(int s, const vector<vector<edge>> &G) {
  const long long linf = 1001001001001001001ll;
  vector<long long> d(G.size(), linf);
  priority_queue<pair<long long, int>, vector<pair<long long, int>>, greater<pair<long long, int>>> q;

  d[s] = 0;
  q.push(make_pair(0, s));

  while (!q.empty()) {
    pair<long long, int> p = q.top();
    q.pop();

    int v = p.second;
    if (d[v] < p.first) continue;
    for (auto &e : G[v]) {
      if (d[e.to] > p.first + e.cost) {
        d[e.to] = p.first + e.cost;
        q.push(make_pair(d[e.to], e.to));
      }
    }
  }

  return d;
}

int main() {
  int n, m, r;
  cin >> n >> m >> r;

  vector<vector<edge>> G(n);
  for (int i = 0; i < m; ++i) {
    int u, v, c;
    cin >> u >> v >> c;

    G[u].push_back(edge(v, c));
    // G[v].push_back(edge(u, c));
  }

  vector<long long> &d = Dijkstra(r, G);
  for (int i = 0; i < d.size(); ++i) {
    if (d[i] == 1001001001001001001ll) cout << "INF" << endl;
    else cout << d[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:34: error: cannot bind non-const lvalue reference of type 'std::vector<long long int>&' to an rvalue of type 'std::vector<long long int>'
   49 |   vector<long long> &d = Dijkstra(r, G);
      |                          ~~~~~~~~^~~~~~
Language: C++

#include<iostream>
#include<map>
#include<string>
#include<vector>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<queue>
using namespace std;
int inf = 1000000000;

int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};

struct Dist{
  int to, from, dist;
};

int main(){
  int n, m, r;
  cin >> n >> m >> r;
  vector<int> v(n, inf);
  vector<Dist> c(m);
  for(int i=0; i<m; i++){
    int s, t, d;
    cin >> s >> t >> d;
    c[i].to = t; c[i].from = s; c[i].dist = d;
  }

  v[r] = 0;
  vector<int> visited(n, inf);
  priority_queue< pair<int, int>, vector< pair<int, int> >, greater< pair<int, int> > > q;
  priority_queue< pair<int, int> > q;
  q.push( make_pair(0, r) );
  while( !q.empty() ){
    pair<int, int> p = q.top();
    cerr << p.first << " " << p.second << endl;
    q.pop();
    int d = p.first;
    int pos = p.second;
    visited[pos] = d;
    v[pos] = min(v[pos], d);
    bool f = true;
    for(int i=0; i<c.size(); i++){
      if( c[i].from == pos && visited[c[i].to] > d + c[i].dist ){
        q.push( make_pair(d + c[i].dist, c[i].to) );
        f = false;
      }
    }
    if( f ) break;

  }

  for(int i=0; i<n; i++){
    if( v[i] == inf ) cout << "INF" << endl;
    else cout << v[i] << endl;
  }

  return 0;
}





// EOF

Compiler output:
a.cc: In function 'int main()':
a.cc:33:36: error: conflicting declaration 'std::priority_queue<std::pair<int, int> > q'
   33 |   priority_queue< pair<int, int> > q;
      |                                    ^
a.cc:32:89: note: previous declaration as 'std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> > > q'
   32 |   priority_queue< pair<int, int>, vector< pair<int, int> >, greater< pair<int, int> > > q;
      |                                                                                         ^
Language: C++

#include <iostream>
using namespace std;

#define Maxvernum 100000
#define Maxarcnum 500000
typedef struct arcs
{
	int start;
	int to;
	int cost;
};

arcs input[Maxarcnum];
int dist[Maxvernum];
int visited[Maxvernum];
int V, E, r;

void Dijkstra(int r)
{
	for (int i=1; i<V; i++)
	{
		int min = INT_MAX;
		int count = 0;
		for (int j=0; j<V; j++)
		{
			if (visited[j] == 0 && dist[j] < min)
			{
				min = dist[j];
				count = j;
			}
		}
		visited[count] = 1;
		for (int i=0; i<E; i++)
			if (input[i].start == count && visited[input[i].to] == 0 && min + input[i].cost < dist[input[i].to])
				dist[input[i].to] = min + input[i].cost;
	}
}
int main()
{
	cin>>V>>E>>r;
	for (int i=0; i<Maxvernum; i++)
		dist[i] = INT_MAX;
	memset(visited, 0, sizeof(visited));
	for (int i=0; i<E; i++)
	{
		cin>>input[i].start>>input[i].to>>input[i].cost;
		if (input[i].start == r)
			dist[input[i].to] = input[i].cost;
	}
	dist[r] = 0;
	visited[r] = 1;
	Dijkstra(r);
	for (int i=0; i<V; i++)
		if (dist[i] != INT_MAX)
			cout<<dist[i]<<endl;
		else
			cout<<"INF"<<endl;
	return 0;
}

Compiler output:
a.cc:6:1: warning: 'typedef' was ignored in this declaration
    6 | typedef struct arcs
      | ^~~~~~~
a.cc: In function 'void Dijkstra(int)':
a.cc:22:27: error: 'INT_MAX' was not declared in this scope
   22 |                 int min = 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 'int main()':
a.cc:42:27: error: 'INT_MAX' was not declared in this scope
   42 |                 dist[i] = INT_MAX;
      |                           ^~~~~~~
a.cc:42:27: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc:43:9: error: 'memset' was not declared in this scope
   43 |         memset(visited, 0, sizeof(visited));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:54:32: error: 'INT_MAX' was not declared in this scope
   54 |                 if (dist[i] != INT_MAX)
      |                                ^~~~~~~
a.cc:54:32: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include "limits.h"
#include <iostream>
using namespace std;

#define Maxvernum 100000
#define Maxarcnum 500000
typedef struct arcs
{
	int start;
	int to;
	int cost;
};

arcs input[Maxarcnum];
int dist[Maxvernum];
int visited[Maxvernum];
int V, E, r;

void Dijkstra(int r)
{
	for (int i=1; i<V; i++)
	{
		int min = INT_MAX;
		int count = 0;
		for (int j=0; j<V; j++)
		{
			if (visited[j] == 0 && dist[j] < min)
			{
				min = dist[j];
				count = j;
			}
		}
		visited[count] = 1;
		for (int i=0; i<E; i++)
			if (input[i].start == count && visited[input[i].to] == 0 && min + input[i].cost < dist[input[i].to])
				dist[input[i].to] = min + input[i].cost;
	}
}
int main()
{
	cin>>V>>E>>r;
	for (int i=0; i<Maxvernum; i++)
		dist[i] = INT_MAX;
	memset(visited, 0, sizeof(visited));
	for (int i=0; i<E; i++)
	{
		cin>>input[i].start>>input[i].to>>input[i].cost;
		if (input[i].start == r)
			dist[input[i].to] = input[i].cost;
	}
	dist[r] = 0;
	visited[r] = 1;
	Dijkstra(r);
	for (int i=0; i<V; i++)
		if (dist[i] != INT_MAX)
			cout<<dist[i]<<endl;
		else
			cout<<"INF"<<endl;
	return 0;
}

Compiler output:
a.cc:7:1: warning: 'typedef' was ignored in this declaration
    7 | typedef struct arcs
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:44:9: error: 'memset' was not declared in this scope
   44 |         memset(visited, 0, sizeof(visited));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

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

const int MAX_E = 500001;
const int MAX_V = 100001;
const int MAX_D = 1000000000;

struct edge { int from, to, cost=MAX_D; };

int main() {
	int V, E, s;
	cin >> V >> E >> s;
	//int table[MAX_V][MAX_V] = {0};
	edge table[MAX_E];

	for (int i = 0; i < E; i++)
		cin >> table[i].from >> table[i].to >> table[i].cost;
	
	//*****************
	int prev[MAX_V];
	int dist[MAX_V];
	bool s_[MAX_V];

	for (int i = 0; i < V; i++)
		dist[i] = MAX_D;
	dist[s] = 0;

	for (int i = 0; i < V; i++)
		prev[i] = -1;
	prev[s] = s;

	for (int i = 0; i < V; i++)
		s_[i] = false;
	s_[s] = true;

	for (int i = 0; i < E; ++i)
	{
		if (table[i].from == s)
		{
			dist[table[i].to] = table[i].cost;
			prev[table[i].to] = s;
		}


	}
	dist[s] = 0;
	s_[s] = true; //????§????

	int mindist = MAX_D;
	bool mark = false;
	for (int i = 1; i < V; i++)
	{
		if (!mark&&i != 1)
			continue;
		int u = s;
		for (int j = 0; j < V; j++)
		{
			if (!s_[j] && dist[j] < mindist)
			{
				u = j;
				mindist = dist[j];
				mark = true;
			}
		}
		s_[u] = true;//?????°???s????§????????????????

		int mindist_ = MAX_D;
			for (int j = 0; j < E; j++)
			{
				if (!s_[table[j].to] && table[j].cost < mindist_)
				{
					if (dist[table[j].from]+table[j].cost < dist[table[j].to])
					{
						dist[table[j].to] = dist[table[j].from] + table[j].cost;
						prev[table[j].to] = table[j].from;
						mark = true;
					}
				}
			}

	//*************************
	/*for (int i = 0; i < V; i++)
	{
		if (prev[i] == -1)
		{
			cout << "INF" << endl;
			continue;
		}
		int d = 0;
		int from, to;
		to = i;
		while (to != s)
		{
			from = prev[to];
			for (int j = 0; j < E; j++)
			{
				if(table[j].from == from && table[j].to == to)
				d += table[j].cost;
			}
			to = prev[to];
		}
		cout << d << endl;
		
	}*/

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

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:116:2: error: expected '}' at end of input
  116 | }
      |  ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
Language: C++

#include <bits\stdc++.h>
using namespace std;
typedef long long ll;
#define INF 2147483647

struct edge{
	int to,cost;
};
int V,E; 

vector <edge> G[100010];

multimap <int,int> l;


ll d[500010];


void dijkstra(int s){
	fill(d,d+V,INF);
	d[s] = 0;
	
	l.insert(make_pair(0,s));
	
	while(l.size() > 0){
		int p = l.begin()->first;
		int v = l.begin()->second;
		l.erase(l.begin());
		
		if(d[v] < p) 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;
				l.insert(make_pair(d[e.to], e.to));
			}
		}
	}
}


int main(){
	
	int r;
	cin >> V >> E >> r;
	for(int i = 0;i < E; i++){
 		edge e;
		int from;
		cin >> from >> e.to >> e.cost;
		G[from].push_back(e);
	}
	
	dijkstra(r);
	
	for(int i = 0;i < V; i++){
		if(d[i] != INF) cout << d[i] << endl;
		else cout << "INF" <<endl;
	}
	return 0;
} 

Compiler output:
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

#define infinity 9999999
#define V 100000
#define C 10000
#define E 500000

struct edge
{
    int t;  
    int d;  
    int next;
};
int count;
int minn; 
int k;
		
int v;
int e;
int r;
vector<int> head; 
vector<edge> edges;
void add_edge(int s,int t,int d);

int main()
{
	while(1)
	{
		
		cin>>v>>e>>r;
		if(v<1||v>V||e<0||e>E||r>=v)
		{
			
			cin.clear();
		}
		else 
			break;
	}
	int i,j;
	vector<int> dis(v,infinity);  
	vector<bool> flag(v,false); 
	head.resize(v,-1);
	edges.resize(e);
	for(i=0;i<e;i++) 
		edges[i].next=-1;

	int point1,point2,cost;
	i=1;
	while(1)
	{
		for(;i<=e;i++)
		{
			cin>>point1>>point2>>cost;
			if(point1<0||point1>C||point2<0||point2>C||point1==point2)
			{
				
				cin.clear();
				break;
			}
                        for(j=head[ponit1];j>=0;j=edges[j].next)
				if(point2==edges[j].t)
				{
					cin.clear();
					break;
				}
			add_edge(point1,point2,cost);
		}
		if(i>e)
			break;
	}

	dis[r]=0;
	for(j=head[r];j>=0;j=edges[j].next)
		dis[edges[j].t]=edges[j].d;
    
	flag[r]=1;
    for(i=1;i<v;i++)
    {
        minn=infinity;
        k=0;
        for(j=0;j<v;j++)
			if(!flag[j]&&minn>dis[j])
			{
				minn=dis[j];
				k=j;
			}
        flag[k]=1;
        for(j=head[k];j>=0;j=edges[j].next)	
			if(!flag[edges[j].t]&&dis[edges[j].t]>dis[k]+edges[j].d)
				dis[edges[j].t]=dis[k]+edges[j].d;
    }
	for (i=0;i<v;i++) 
    {  
		if(dis[i]<infinity)
			cout<<dis[i]<<"\r\n"; 
		else
			cout<<"INF"<<"\r\n";
    }    
    return 0;
}

void add_edge(int s,int t,int d) 
{    
    edges[count].t=t;
    edges[count].d=d;
    edges[count].next=head[s];
    head[s]=count;
	count++;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:36: error: 'ponit1' was not declared in this scope; did you mean 'point1'?
   62 |                         for(j=head[ponit1];j>=0;j=edges[j].next)
      |                                    ^~~~~~
      |                                    point1
Language: C++

#include <iostream>
#include <vector>

using namespace std;



int main() {
	int V,E,r,s,t,din;
	vector<int> d,weight;
	vector<pair<int,int> > edge;

	cin >> V >> E >> r;
	for(int i=0;i<E;i++){
		cin >> s >> t >> din;
		edge.push_back(make_pair(s,t));
		weight.push_bach(din);
	}

	for(int i=0;i<V;i++) {
		d[i] = 10000000;
	}
	if(d.size()) d[r] = 0;
	if(!d.size()) d.puch_back(0);
	for(int i=0;i<V-1;i++) {
		for(int j=0;j<edge.size();j++) {
			d[edge[j].second] = min(d[edge[j].second],d[edge[j].first]+weight[j]);
		}
	}
	for(int i=0;i<V;i++) {
		if(d[i] == 10000000) {
			cout << "INF" << endl;
		} else {
		    cout << d[i] << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: 'class std::vector<int>' has no member named 'push_bach'; did you mean 'push_back'?
   17 |                 weight.push_bach(din);
      |                        ^~~~~~~~~
      |                        push_back
a.cc:24:25: error: 'class std::vector<int>' has no member named 'puch_back'; did you mean 'push_back'?
   24 |         if(!d.size()) d.puch_back(0);
      |                         ^~~~~~~~~
      |                         push_back
Language: C++

#include<iostream>
using namespace std;
int V, E, R, S[500010], T[500010], D[500010]; // ????????§?????????????????\???
int C[100010]; // ??????????????§??????????????¢?????????
// ???????????¨????????°?????¨???????????????????????§?¶?????¨????
const int Inf = 10000*100000+100;

int main() {
  cin >> V >> E >> R;
  for (int i=0; i<E; ++i)
    cin >> S[i] >> T[i] >> D[i]; // ???????????\??? 
  for(int i=0;i<V;i++)
    C[i]=Inf;
  C[R]=0;// C????????????: C[R]???0???,??????Inf???
  for (int t=0; t<V; ++t)
    {                           // V?????°?????????
      bool update = false;
      for (int i=0; i<E; ++i)
      {
	int s = S[i], t = T[i], d = D[i]; // i???????????????s,t,d????????????
	if (C[s] < Inf && C[t]>d+C[s])
	  { // ???s,t??§????????§????????????
	    C[t] =d+C[s]; // C[t]?????´??°;
	    update = true; // ??´??°???????????£????????¨????¨????
	  }
      }
      if (!update) break; // ????????????????????´??°??????????????°???????????£?????????
    }
  for(int i=0;i<V;i++)
    {
      if(C[i]==Inf)
	cout<<INF<<endl;
      else
	cout<<C[i]<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:15: error: 'INF' was not declared in this scope; did you mean 'Inf'?
   32 |         cout<<INF<<endl;
      |               ^~~
      |               Inf
Language: C++

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

int main(){
  int iv,ie,r;
  cin >> iv >> ie >> r;
  vector<int> d;
  for (int i=0;i<iv;i++){
    d[i]= 100000000;
  }
  d[r]=0;
  vector<pair<int,int> > w(ie);
  vector<int> cost(ie);
  for(int i=0;i<ie;i++){
    int s0,e0,d0;
    cin>>s0>>e0>>d0;
    w[i] = make_pair(s0,e0);
    cost[i]=d0;
  }
  for(int i=0;i<iv-1;i++){
    for(int j=0;j<ie;j++){
      int s1,e1,d1;
      s1=w[j].first;
      e1=w[j].second;
      d1=cost[j];
      d[e1]=min(d[e1],d[s1]+d1);
    }
   }

  for(int i=0;i<iv;i++){
    if(d[i]==1000000000){
      cout<<INF<<endl;
    }else{
      cout<<d[i]<<endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:13: error: 'INF' was not declared in this scope
   33 |       cout<<INF<<endl;
      |             ^~~
Language: C++

#include <iostream>
#include <queue>
#include <vector>
#include <functional>  
using namespace std;
 
const int maxnum = 100000;
const int maxint = 1000000000;
 
int V;                               //V -- V nodes
int E;                               //E -- the number of lines
int s;                               //s -- the source node
int dist[maxnum];                    //dist[] -- the distance from the ith node to the source node
int c[maxnum][maxnum];               //c[][] -- every two nodes' distance
priority_queue< pair<int,int>, vector<pair<int,int> >, greater< pair<int,int> > > Q;  //min_priority_queue
 
int main()
{
    int m,n,len;
    cin >> V >> E >> s;
    for(int i = 0; i < V; i++)
    {
        for(int j = 0;j < V;j++)
        {
            c[i][j] = maxint;
        }
    }
    for(int i = 0; i < E; i++)
    {
        cin >> m >> n >> len;
        c[m][n] = len;
    } 
    for(int i = 0; i < V; i++)
    {
		if(i != s)
		{
			dist[i] = c[s][i];
			Q.push(make_pair(dist[i],i));
		}
		else
		{
			dist[s] = 0;
			Q.push(make_pair(dist[s],s));
		}
    }
    while(!Q.empty())
	{
		int u = Q.top().second;
		Q.pop();
		for(int i = 0; i < V; i++)
		{
			if(c[u][i] < maxint)
				if(dist[i] > dist[u] + c[u][i])
				{
					dist[i] = dist[u] + c[u][i]; 
					Q.push(make_pair(dist[i],i));
				}
		}
		
	}
    for(int i = 0; i < V; i++)
    {
        if(dist[i] < maxint)
            cout<<dist[i]<<endl;
        else
            cout<<"INF"<<endl;
    }
}

Compiler output:
/tmp/cc2nnVEM.o: in function `main':
a.cc:(.text+0x1b6): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/cc2nnVEM.o
a.cc:(.text+0x21c): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/cc2nnVEM.o
a.cc:(.text+0x24a): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/cc2nnVEM.o
a.cc:(.text+0x25f): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/cc2nnVEM.o
a.cc:(.text+0x393): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/cc2nnVEM.o
a.cc:(.text+0x3bc): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/cc2nnVEM.o
/tmp/cc2nnVEM.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x485): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/cc2nnVEM.o
a.cc:(.text+0x49e): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/cc2nnVEM.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <string.h>

#include <fstream>
#include <time.h>
#include <stdlib.h>
#include <direct.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> edgeTo;
typedef pair<int, ll> distTo;

#define maxN 500000
#define INF 1e18

vector<edgeTo> g[maxN];
priority_queue<distTo, vector<distTo>, greater<distTo> > q;
int n, m, s;
ll d[maxN]; //d[u]: do dai dd ngan nhat tu s den u

void ReadGraph()
{
    int u, v, c;
    cin>>n>>m>>s;
    for (int i = 0; i < m; ++i)
    {
        cin>>u>>v>>c;
        g[u].push_back(edgeTo(v, c));
    }
}

void Init()
{
    for (int u = 0; u < n; ++u)
        d[u] = INF;
    d[s] = 0;
    q.push(distTo(s, d[s]));
}

void Solve()
{
    Init();
    while (!q.empty())
    {
        int u = (int)q.top().first; ll du = (ll)q.top().second;
        q.pop();

        if (du != d[u]) continue;

        for (int i = 0; i < g[u].size(); ++i)
        {
            int v = (int)g[u][i].first, c = (int)g[u][i].second;
            if (d[v] > d[u] + c)
            {
                d[v] = d[u] + c;
                q.push(distTo(v, d[v]));
            }
        }
    }
}

void WriteANS()
{
    for (int u = 0; u < n; ++u)
    {
        if (d[u] == INF)
            cout<<"INF\n";
        else cout<<d[u]<<"\n";
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    ReadGraph();
    Solve();
    WriteANS();
    return 0;
}

Compiler output:
a.cc:11:10: fatal error: direct.h: No such file or directory
   11 | #include <direct.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <string.h>

#include <fstream>
#include <time.h>
#include <stdlib.h>
#include <direct.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> edgeTo;
typedef pair<int, ll> distTo;

#define maxN 500000
#define INF 1e18

vector<edgeTo> g[maxN];
priority_queue<distTo, vector<distTo>, greater<distTo> > q;
int n, m, s;
ll d[maxN]; //d[u]: do dai dd ngan nhat tu s den u

void ReadGraph()
{
    int u, v, c;
    cin>>n>>m>>s;
    for (int i = 0; i < m; ++i)
    {
        cin>>u>>v>>c;
        g[u].push_back(edgeTo(v, c));
    }
}

void Init()
{
    for (int u = 0; u < n; ++u)
        d[u] = INF;
    d[s] = 0;
    q.push(distTo(s, d[s]));
}

void Solve()
{
    Init();
    while (!q.empty())
    {
        int u = (int)q.top().first; ll du = (ll)q.top().second;
        q.pop();

        if (du != d[u]) continue;

        for (int i = 0; i < g[u].size(); ++i)
        {
            int v = (int)g[u][i].first, c = (int)g[u][i].second;
            if (d[v] > d[u] + c)
            {
                d[v] = d[u] + c;
                q.push(distTo(v, d[v]));
            }
        }
    }
}

void WriteANS()
{
    for (int u = 0; u < n; ++u)
    {
        if (d[u] == INF)
            cout<<"INF\n";
        else cout<<d[u]<<"\n";
    }
}

int main()
{
    ReadGraph();
    Solve();
    WriteANS();
    return 0;
}

Compiler output:
a.cc:11:10: fatal error: direct.h: No such file or directory
   11 | #include <direct.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <utility>
#include <cstring>
#include <cstdio>

using namespace std;
typedef long long int llg;

const int INF = INT_MAX;
#define REP(var, count) for(int var=0; var<count; var++)


int vert[100010];
int edge[500010][3];

int main(void) {
	int V, E, r;
	scanf("%d", &V);
	scanf("%d", &E);
	scanf("%d", &r);
	
	REP(v, V) { vert[v] = INF; }
	vert[r] = 0;
	
	REP(i, E) {
		scanf("%d", &edge[i][0]);
		scanf("%d", &edge[i][1]);
		scanf("%d", &edge[i][2]);
	}
	
	REP(v, V) {
		bool update = false;
		REP(i, E) {
			int s = edge[i][0];
			int t = edge[i][1];
			vert[t] = min(vert[t], vert[s] + edge[i][2]);
			update = true;
		}
		if ( !update ) { break; }
	}
	
	REP(v, V) {
		if ( vert[v] == INF ) {
			cout << "INF" << endl;
		} else {
			cout << vert[v] << endl;
		}
	}

}

Compiler output:
a.cc:13:17: error: 'INT_MAX' was not declared in this scope
   13 | const int INF = INT_MAX;
      |                 ^~~~~~~
a.cc:9:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <cstdio>
  +++ |+#include <climits>
    9 |
Language: C++

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

const long long INF=0xfffffffe;
const int FIRSTALLOCATE=100000;
typedef std::pair<int,int> P;

struct nodes{
		int number;
		long long cost;
		std::vector<P> edge;
};
std::vector<nodes> node(FIRSTALLOCATE);
bool operator>(const nodes *node_a,const nodes *node_b){
	return node_a.cost>node_b.cost;
}
std::priority_queue<nodes*,std::vector<nodes*>,std::greater<nodes*>  >pq;
int v,e,r;

void initialize(void){
	for(int lp1=0;lp1<FIRSTALLOCATE;lp1++){
		node[lp1].cost=INF;
		node[lp1].number=lp1;
	}
}

void input(void){
	int m1,m2,m3;
	std::cin>>v>>e>>r;
	for(int lp=0;lp<e;lp++){
		scanf("%d%d%d",&m1,&m2,&m3);
		m1--; m2--;
		node[m1].edge.push_back(std::make_pair(m2,m3));
		node[m2].edge.push_back(std::make_pair(m1,m3));
	}
}

void solve(void){
	node[r].cost=0;
	pq.push(&node[r]);
	while(!pq.empty()){
		nodes* node_now=pq.top();
		pq.pop();
		for(auto x:node_now->edge){
			nodes* node_next=&node[x.first];
			int node_next_cost=x.second+node_now->cost;
			if(node_next_cost<node_next->cost){
				node_next->cost=node_next_cost;
				pq.push(node_next);
			}
		}
	}
}

void output(void){
	for(int lp=0;lp<v;lp++){
		if(node[lp].cost==INF){
			printf("INF\n");
		}else{
			printf("%lld\n",node[lp].cost);
		}
	}
}

int main(void){
	initialize();
	input();
	solve();
	output();
	return 0;
}



Compiler output:
a.cc:18:6: error: 'bool operator>(const nodes*, const nodes*)' must have an argument of class or enumerated type
   18 | bool operator>(const nodes *node_a,const nodes *node_b){
      |      ^~~~~~~~
Language: C++

/**
 * GRL_1-A - Shortest Path - Single Source Shortest Path
 */

#include <iostream>
#include <vector>
#include <queue>

using namespace std;
using ULL = unsigned long long;

struct edge {
    int to;
    ULL cost;
};

int main() {

    int V, E, r;
    cin >> V >> E >> r;

    vector<edge> G[V];
    ULL cost[V];

    for (int i = 0; i < E; i++) {
        int s, t, d;
        cin >> s >> t >> d;
        G[s].push_back(edge{t, (ULL) d});
    }

    fill(cost, cost + V, ULLONG_MAX);

    priority_queue<pair<ULL, int>> pq;
    pq.push(make_pair(0, r));

    while (!pq.empty()) {

        pair<ULL, int> p = pq.top();
        pq.pop();

        if (p.first >= cost[p.second]) continue;

        cost[p.second] = p.first;

        for (edge e : G[p.second]) {
            if (p.first + e.cost < cost[e.to]) {
                pq.push(make_pair(p.first + e.cost, e.to));
            }
        }
    }

    for (int i = 0; i < V; i++) {
        if (cost[i] != ULLONG_MAX) {
            cout << cost[i] << endl;
        } else {
            cout << "INF" << endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:26: error: 'ULLONG_MAX' was not declared in this scope
   31 |     fill(cost, cost + V, ULLONG_MAX);
      |                          ^~~~~~~~~~
a.cc:8:1: note: 'ULLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <queue>
  +++ |+#include <climits>
    8 |
Language: C++

#include <iostream>
#include <vector>
#include <queue>

using namespace std;
using ULL = unsigned long long;

struct edge {
    int to;
    ULL cost;
};

int main() {

    int V, E, r;
    cin >> V >> E >> r;

    vector<edge> G[V];
    ULL cost[V];

    for (int i = 0; i < E; i++) {
        int s, t, d;
        cin >> s >> t >> d;
        G[s].push_back(edge{t, (ULL) d});
    }

    fill(cost, cost + V, ULLONG_MAX);

    priority_queue<pair<ULL, int>> pq;
    pq.push(make_pair(0, r));

    while (!pq.empty()) {

        pair<ULL, int> p = pq.top();
        pq.pop();

        if (p.first >= cost[p.second]) continue;

        cost[p.second] = p.first;

        for (edge e : G[p.second]) {
            if (p.first + e.cost < cost[e.to]) {
                pq.push(make_pair(p.first + e.cost, e.to));
            }
        }
    }

    for (int i = 0; i < V; i++) {
        if (cost[i] != ULLONG_MAX) {
            cout << cost[i] << endl;
        } else {
            cout << "INF" << endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:26: error: 'ULLONG_MAX' was not declared in this scope
   27 |     fill(cost, cost + V, ULLONG_MAX);
      |                          ^~~~~~~~~~
a.cc:4:1: note: 'ULLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <queue>
  +++ |+#include <climits>
    4 |
Language: C++

#include<bits/stdc++.h>
#define SIZE 100005
#define MAX_V 100001
#define INF (1e9 + 1)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;


struct edge{
	int to,cost;
};

int V,E,r,a,b,c;
vector< edge > G[MAX_V];

int d[MAX_V];
void dijkstra(){
	int i;
	for(i=0;i<MAX_V;i++) d[i]=INF;
	d[r]=0;
	priority_queue< P > Q;
	Q.push(P(0,r));
	while(!Q.empty()){
		P p=Q.top();
		Q.pop();
		int pos=p.second,cost=-p.first;
		if(cost>d[pos]) continue;
		for(i=0;i<G[pos].size();i++){
			edge e=G[pos][i];
			int to=e.to;
			int newcost=cost+e.cost;
			if(newcost<d[to]){
				d[to]=newcost;
				Q.push(P(-d[to],to));
			}
		}
	}
	for(i=0;i<V;i++){
		if(d[i]==INF)printf("INF\n");
		else printf("%d\n",d[i]);
	}
}

int main(){
	int i;
	scanf("%d %d %d",&V,&E,&r);
	for(i=0;i<E;i++){
		scanf("%d %d %%d",&a,&b,&c);
		G[a].push_back((edge){b,c})
	}
	dijkstra();
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:44: error: expected ';' before '}' token
   50 |                 G[a].push_back((edge){b,c})
      |                                            ^
      |                                            ;
   51 |         }
      |         ~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <fstream>
#include <climits>
#decine INF INT_MAX
using namespace std;

class vertex{
public:
  class edge{
  public:
    int to;
    int weight;
    edge(int to, int weight){
      this->to = to;
      this->weight = weight;
    }
  };

  vector<edge> edges;
  int num;
  int dis;

  vertex(){
    num=n;
    n++;
    vertexes.push_back(this);
  }

  bool operator< (const vertex& v) const{
    return dis < v.dis;
  }

  bool operator> (const vertex& v) const{
    return dis > v.dis;
  }

  static void dijkstra(int start){
    //距離の初期化
    for(int i=0; i<n; i++) vertexes[i]->dis=INF;
    vertexes[start]->dis=0;

    //プライオリティキューを初期化、始点を格納
    priority_queue<vertex, vector<vertex>, greater<vertex> > pq; pq.push(*vertexes[start]);

    //キューから最短距離を取り出していく
    while(!pq.empty()){
      vertex now = pq.top(); pq.pop(); //キューの先頭をポップ
      if(now.dis>vertexes[now.num]->dis) continue;

      //ポップしたキューの頂点集合について最短距離更新
      for(int i=0; i<now.edges.size(); i++){
        int newDis = now.dis+now.edges[i].weight;
        vertex* next = vertexes[now.edges[i].to];

        //もし最短距離が更新されたら、キューに入れなおす
        if(newDis < next->dis){
          next->dis = newDis;
          pq.push(*next);
        }
      }

    }


  }

  //各頂点番号と最短距離を出力するための関数
  static void print(){
    fstream cout("out.txt");
    for(int i=0; i<n; i++){
      if(vertexes[i]->dis==INF){
        cout << "INF" << endl;
      }else{
        cout << vertexes[i]->dis << endl;
      }
    }
  }
private:
  static int n;
  static vector<vertex*> vertexes;
};

//staticメンバ変数の初期化
int vertex::n=0;
vector<vertex*> vertex::vertexes;

int main(){
  fstream cin("in.txt");
  int n, e, r; cin >> n >> e >> r;

  vertex graph[n];

  //入力を隣接リストのようなものに格納
  int v, to, weight;
  for(int i=0; i<e; i++){
    cin >> v >> to >> weight;

    vertex::edge e(to, weight);
    graph[v].edges.push_back(e);
  }

  vertex::dijkstra(r); //0始点のダイクストラ法

  vertex::print();

  return 0;
}



Compiler output:
a.cc:6:2: error: invalid preprocessing directive #decine; did you mean #define?
    6 | #decine INF INT_MAX
      |  ^~~~~~
      |  define
a.cc: In static member function 'static void vertex::dijkstra(int)':
a.cc:41:45: error: 'INF' was not declared in this scope
   41 |     for(int i=0; i<n; i++) vertexes[i]->dis=INF;
      |                                             ^~~
a.cc: In static member function 'static void vertex::print()':
a.cc:73:28: error: 'INF' was not declared in this scope
   73 |       if(vertexes[i]->dis==INF){
      |                            ^~~
Language: C++

// GRL_1_A.cpp
// dijkstra法
#include <bits/stdc++.h>
using namespace std;

const int MAX_V=100000;
const int MAX_E=500000;
const int INF=INT_MAX;

struct E{
  int to,cost;
  E(Int t, int c) to(t),cost(c) {};
};
typedef pair<int,int> pii;

int v;                          // 頂点数
vector<E> g[MAX_V];             // 隣接リスト
int d[MAX_V];                   // 頂点sからの最短距離


void dijkstra(ints){
  // 準備
  fill(d,d+v,INF);
  d[s]=0;
  priority_queue<pii,vector<pii>, greater<pii> > q; // greater<pii>でfirstが小さい順に取り出せるようにする
  q.push(pii(0,s));

  // 頂点ｓから各頂点への最短距離の計算
  while(!q.empty()){
    //　まだ確定していない頂点のうち距離が最小のものを探す
    // その頂点に関しては、最短距離が確定する
    pii p=q.top();
    q.pop();
    int from=p.second;
    if(d[from]<p.first)continue; // 最短距離でなければ無視
    // ここまでくれば頂点fromは最短距離確定

    // 最短距離が確定した頂点に隣接する頂点の情報を更新
    for(int i=0;i<g[from].size();++i){
      int to=g[from][i].to;
      int cost=g[from][i].cost;

      if(d[to]>d[from]+cost){   // 最短距離となりうる場合
        d[to]=d[from]+cost;
        q.push(pii(d[to],to));  // 最短距離の候補をヒープに挿入
      }
    }

  }
}

int main() {
  // 入力
  // gv : 頂点の数
  // ge : 辺の数
  // gr : 始点
  int gv,ge,gr;
  cin>>gv>>ge>>gr;
  v=gv;

  for(int i=0;i<ge;++i){
    // 入力
    // ga : 辺の始点
    // gt : 辺の終点
    // gd : 辺の重み
    int gs,gt,gd;
    cin>>gs>>gt>>gd;
    g[gs]push_back(E(gt,gd));   // 2頂点間の辺の情報を記録
  }

  dijkstra(gr);

  // 出力は、頂点grから各頂点への最短距離
  for(int i=0;i<v;++i){
    if(d[i]!=INF)
      cout<<d[i]<<endl;
    else                        // 頂点iに行けない場合
      cout<< "INF"<<endl;
  }

  return 0;
}



Compiler output:
a.cc:12:8: error: expected ')' before 't'
   12 |   E(Int t, int c) to(t),cost(c) {};
      |    ~   ^~
      |        )
a.cc:21:6: error: variable or field 'dijkstra' declared void
   21 | void dijkstra(ints){
      |      ^~~~~~~~
a.cc:21:15: error: 'ints' was not declared in this scope; did you mean 'int'?
   21 | void dijkstra(ints){
      |               ^~~~
      |               int
a.cc: In function 'int main()':
a.cc:68:10: error: expected ';' before 'push_back'
   68 |     g[gs]push_back(E(gt,gd));   // 2頂点間の辺の情報を記録
      |          ^~~~~~~~~
      |          ;
a.cc:71:3: error: 'dijkstra' was not declared in this scope
   71 |   dijkstra(gr);
      |   ^~~~~~~~
Language: C++

#include<iostream>
#include<queue>
#include<vector>

#define MAX 100000
#define INF INT_MAX
#define NO 0
#define WENT 1

using namespace std;

void Dijkstra(void);

int V, E, r;
vector< vector<pair<int,int> > >  v;
vector<int> cost, visited;
 

int main() {
  int s, t, d;

  cin >> V >> E >> r;
  v.resize(V);

  for(int i=0; i<E; i++) {
    cin >> s >>t >> d;
    v[s].push_back(make_pair(t,d)); //s番目〜t番目のコストはd                                       
   }

  //cout << 'a' << endl;
  Dijkstra();

  //cout << "b" << endl;

  for(int i=0; i<V; i++) {
    if(visited[i] == WENT) cout << cost[i] << endl;
    else cout << "INF" << endl;
  }

  return 0;
}

void Dijkstra(){
  int x, y, z;
  priority_queue< pair<int,int> , vector< pair<int,int> >, greater< pair<int, int> > > p;//greaterで小さい順に取り出せる

  cost.resize(V);
  visited.resize(V);

  for(int i=0;i<V;i++){
    cost[i]=INF;
    visited[i] = NO;
  }
  cost[r] = 0;   //startのコストを０に
 
  p.push(make_pair(0,r));//startのrはコスト０

  while(!p.empty()) {
    x=p.top().second; //topの二番目の要素(pair<int,int>の後半の要素)
    p.pop();

    visited[x] = WENT;

    for(int i=0; i<v[x].size(); i++) {
      y = v[x][i].first;
      z = v[x][i].second;//y：edge先のノード、z：x~yへのコスト

      if(visited[y] == NO) //まだxがyになったことがなければ
	if(cost[y] > cost[x] + z) {//元々yに行くためのコストが、今来たコストよりでかければ
	  cost[y] = cost[x] + z;
	  p.push(make_pair(cost[y],y));
	}
    }
  }
}
 



Compiler output:
a.cc: In function 'void Dijkstra()':
a.cc:6:13: error: 'INT_MAX' was not declared in this scope
    6 | #define INF INT_MAX
      |             ^~~~~~~
a.cc:51:13: note: in expansion of macro 'INF'
   51 |     cost[i]=INF;
      |             ^~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include<queue>
  +++ |+#include <climits>
    3 | #include<vector>
Language: C++

#include<iostream>
#include<queue>
#include<vector>

#define MAX 100000
#define INF INT_MAX
#define NO 0
#define WENT 1

using namespace std;

void Dijkstra(void);

int V, E, r;
vector< vector<pair<int,int> > >  v;
vector<int> cost, visited;
 

int main() {
  int s, t, d;

  cin >> V >> E >> r;
  v.resize(V);

  for(int i=0; i<E; i++) {
    cin >> s >>t >> d;
    v[s].push_back(make_pair(t,d)); 
   }


  Dijkstra();


  for(int i=0; i<V; i++) {
    if(visited[i] == WENT) cout << cost[i] << endl;
    else cout << "INF" << endl;
  }

  return 0;
}

void Dijkstra(){
  int x, y, z;
  priority_queue< pair<int,int> , vector< pair<int,int> >, greater< pair<int, int> > > p;

  cost.resize(V);
  visited.resize(V);

  for(int i=0;i<V;i++){
    cost[i]=INF;
    visited[i] = NO;
  }
  cost[r] = 0;
 
  p.push(make_pair(0,r));

  while(!p.empty()) {
    x=p.top().second;
    p.pop();

    visited[x] = WENT;

    for(int i=0; i<v[x].size(); i++) {
      y = v[x][i].first;
      z = v[x][i].second;

      if(visited[y] == NO)
	if(cost[y] > cost[x] + z) {
	  cost[y] = cost[x] + z;
	  p.push(make_pair(cost[y],y));
	}
    }
  }
}
 



Compiler output:
a.cc: In function 'void Dijkstra()':
a.cc:6:13: error: 'INT_MAX' was not declared in this scope
    6 | #define INF INT_MAX
      |             ^~~~~~~
a.cc:50:13: note: in expansion of macro 'INF'
   50 |     cost[i]=INF;
      |             ^~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include<queue>
  +++ |+#include <climits>
    3 | #include<vector>