Language: C++

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

struct Edge { int to, cost; }

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

typedef pair<int, int> Pii;

int const INF = INT_MAX/4;

Graph G;

int main() {
  
  int V, E, r; cin >> V >> E >> r;
  G.resize(V);
  for(int i=0; i<E; i++) {
    int s, t, d; cin >> s >> t >> d;
    Graph[s].push_back((Edge){t, d});
  }

  int dist[N]; fill(dist, dist+N, INF);
  dist[r] = 0;
  priority_queue<Pii> pq;
  pq.push(Pii(0, r));
  while(!pq.empty()) {
    const Pii pii = pq.top(); pq.pop();
    const int cost = pii.first;
    const int now = pii.second;
    for(int i=0; i<G[now].size(); i++) {
      const int next = G[now][i].to;
      if(dist[next] > cost+G[now][i].cost) {
        dist[next] = cost+G[now][i].cost;
        pq.push(Pii(dist[next], next));
      }
    }
  }
  
  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:9:22: error: invalid declarator before 'Edges'
    9 | typedef vector<Edge> Edges;
      |                      ^~~~~
a.cc:10:16: error: 'Edges' was not declared in this scope; did you mean 'Edge'?
   10 | typedef vector<Edges> Graph;
      |                ^~~~~
      |                Edge
a.cc:10:21: error: template argument 1 is invalid
   10 | typedef vector<Edges> Graph;
      |                     ^
a.cc:10:21: error: template argument 2 is invalid
a.cc:14:17: error: 'INT_MAX' was not declared in this scope
   14 | int const INF = INT_MAX/4;
      |                 ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <queue>
  +++ |+#include <climits>
    5 | using namespace std;
a.cc: In function 'int main()':
a.cc:21:5: error: request for member 'resize' in 'G', which is of non-class type 'Graph' {aka 'int'}
   21 |   G.resize(V);
      |     ^~~~~~
a.cc:24:10: error: structured binding declaration cannot have type 'Graph' {aka 'int'}
   24 |     Graph[s].push_back((Edge){t, d});
      |          ^~~
a.cc:24:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:24:11: error: conflicting declaration 'auto s'
   24 |     Graph[s].push_back((Edge){t, d});
      |           ^
a.cc:23:9: note: previous declaration as 'int s'
   23 |     int s, t, d; cin >> s >> t >> d;
      |         ^
a.cc:24:13: error: expected initializer before '.' token
   24 |     Graph[s].push_back((Edge){t, d});
      |             ^
a.cc:24:36: error: expected primary-expression before ')' token
   24 |     Graph[s].push_back((Edge){t, d});
      |                                    ^
a.cc:27:12: error: 'N' was not declared in this scope
   27 |   int dist[N]; fill(dist, dist+N, INF);
      |            ^
a.cc:27:21: error: 'dist' was not declared in this scope
   27 |   int dist[N]; fill(dist, dist+N, INF);
      |                     ^~~~
a.cc:35:21: error: invalid types 'Graph {aka int}[const int]' for array subscript
   35 |     for(int i=0; i<G[now].size(); i++) {
      |                     ^
a.cc:36:25: error: invalid types 'Graph {aka int}[const int]' for array subscript
   36 |       const int next = G[now][i].to;
      |                         ^
a.cc:37:29: error: invalid types 'Graph {aka int}[const int]' for array subscript
   37 |       if(dist[next] > cost+G[now][i].cost) {
      |                             ^
a.cc:38:28: error: invalid types 'Graph {aka int}[const int]' for array subscript
   38 |         dist[next] = cost+G[now][i].cost;
      |                            ^