Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define ssort(a) sort(a.begin(), a.end())
#define INF 1001001001
#define INFll 100100100100100
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;

using namespace std;
using ull = unsigned long long;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;


#define MAX_V 300000;

struct edge {
    int to;
    int cost;
};

// <最短距離, 頂点の番号>
using P = pair<int, int>;

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

void dijkstra(int s) {
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d, d+MAX_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() {
    cin >> V;
    int E;
    cin >> E;
    int s;
    cin >> s;
    if(s>=2504){
      s=2504;
    }
    for (int i=0; i<E; ++i) {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        //有向グラフ
        a--; b--;
        rep(j, 2505){
          if(j-c>=0){
            edge e = {b+50*(j-c), d};
            G[a+50*j].push_back(e);
            edge e2 = {a+50*(j-c), d};
            G[b+50*j].push_back(e2);
          }
        }
    }
    rep(i, V){
      int nc, nd;
      cin >> nc >> nd;
      rep(j, 2505){
        if(j+nc<=2504){
          edge e3 = {i+50*(j+nc), nd};
          G[i+50*j].push_back(e3);
        } else {
          edge e3 = {i+50*2504, nd};
          G[i+50*j].push_back(e3);
        }
      }
    }
    dijkstra(50*s);
    repo(i, V-1){
      int ans=INF;
      rep(j,2505){
        ans=min(d[i+50*j], ans);
      }
      cout << ans << endl;
    }
    return 0;
}


Compiler output:
a.cc:17:21: error: expected ']' before ';' token
   17 | #define MAX_V 300000;
      |                     ^
a.cc:28:16: note: in expansion of macro 'MAX_V'
   28 | vector<edge> G[MAX_V];
      |                ^~~~~
a.cc:28:21: error: expected unqualified-id before ']' token
   28 | vector<edge> G[MAX_V];
      |                     ^
a.cc:17:21: error: expected ']' before ';' token
   17 | #define MAX_V 300000;
      |                     ^
a.cc:29:7: note: in expansion of macro 'MAX_V'
   29 | int d[MAX_V];
      |       ^~~~~
a.cc:29:12: error: expected unqualified-id before ']' token
   29 | int d[MAX_V];
      |            ^
a.cc: In function 'void dijkstra(int)':
a.cc:33:10: error: 'd' was not declared in this scope
   33 |     fill(d, d+MAX_V, INF);
      |          ^
a.cc:33:20: error: expected primary-expression before ',' token
   33 |     fill(d, d+MAX_V, INF);
      |                    ^
a.cc:43:25: error: 'G' was not declared in this scope
   43 |         for (int i=0; i<G[v].size(); ++i) {
      |                         ^
a.cc: In function 'int main()':
a.cc:70:13: error: 'G' was not declared in this scope
   70 |             G[a+50*j].push_back(e);
      |             ^
a.cc:82:11: error: 'G' was not declared in this scope
   82 |           G[i+50*j].push_back(e3);
      |           ^
a.cc:85:11: error: 'G' was not declared in this scope
   85 |           G[i+50*j].push_back(e3);
      |           ^
a.cc:93:17: error: 'd' was not declared in this scope
   93 |         ans=min(d[i+50*j], ans);
      |                 ^