Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
template<class T>void chmax(T &a,T b){if(a<b)a=b;}
template<class T>void chmin(T &a,T b){if(a>b)a=b;}
constexpr int INF=1000000000000000000;
constexpr int mod=1000000007;

struct edge{int to,silver,cost;};
define PP pair<int,P>
int n,m,s,c[50],d[50],dist[50][2451];
vector<edge>v[50];
void dijkstra(){
    rep(i,50){
        rep(j,2451){
            dist[i][j]=INF;
        }
    }
    priority_queue<PP,vector<PP>,greater<PP>>q;
    q.push({0,{0,s}});
    dist[0][s]=0;
    while(!q.empty()){
        PP p=q.top();
        q.pop();
        if(dist[p.se.fi][p.se.se]!=p.fi)continue;
        for(int i=0;p.se.se+c[p.se.fi]*i<=2450;i++){
            for(edge e:v[p.se.fi]){
                if(p.se.se+c[p.se.fi]*i-e.silver<0)continue;
                if(dist[e.to][p.se.se+c[p.se.fi]*i-e.silver]>p.fi+d[p.se.fi]*i+e.cost){
                    dist[e.to][p.se.se+c[p.se.fi]*i-e.silver]=p.fi+d[p.se.fi]*i+e.cost;
                    q.push({dist[e.to][p.se.se+c[p.se.fi]*i-e.silver],{e.to,p.se.se+c[p.se.fi]*i-e.silver}});
                }
            }
        }
    }
}
signed main(){
    cin>>n>>m>>s;
    chmin(s,2450ll);
    rep(i,m){
        int u,w,a,b;
        cin>>u>>w>>a>>b;
        u--,w--;
        v[u].pb({w,a,b});
        v[w].pb({u,a,b});
    }
    rep(i,n)cin>>c[i]>>d[i];
    dijkstra();
    rep(i,n){
        if(i){
            int ans=INF;
            rep(j,2451)chmin(ans,dist[i][j]);
            cout<<ans<<endl;
        }
    }
    return 0;
}


Compiler output:
a.cc:17:1: error: 'define' does not name a type
   17 | define PP pair<int,P>
      | ^~~~~~
a.cc: In function 'void dijkstra()':
a.cc:23:13: error: 'dist' was not declared in this scope
   23 |             dist[i][j]=INF;
      |             ^~~~
a.cc:26:20: error: 'PP' was not declared in this scope; did you mean 'P'?
   26 |     priority_queue<PP,vector<PP>,greater<PP>>q;
      |                    ^~
      |                    P
a.cc:26:32: error: template argument 2 is invalid
   26 |     priority_queue<PP,vector<PP>,greater<PP>>q;
      |                                ^
a.cc:26:44: error: template argument 1 is invalid
   26 |     priority_queue<PP,vector<PP>,greater<PP>>q;
      |                                            ^~
a.cc:26:44: error: template argument 2 is invalid
a.cc:26:44: error: template argument 3 is invalid
a.cc:27:7: error: request for member 'push' in 'q', which is of non-class type 'int'
   27 |     q.push({0,{0,s}});
      |       ^~~~
a.cc:27:18: error: 's' was not declared in this scope
   27 |     q.push({0,{0,s}});
      |                  ^
a.cc:28:5: error: 'dist' was not declared in this scope
   28 |     dist[0][s]=0;
      |     ^~~~
a.cc:29:14: error: request for member 'empty' in 'q', which is of non-class type 'int'
   29 |     while(!q.empty()){
      |              ^~~~~
a.cc:30:11: error: expected ';' before 'p'
   30 |         PP p=q.top();
      |           ^~
      |           ;
a.cc:31:11: error: request for member 'pop' in 'q', which is of non-class type 'int'
   31 |         q.pop();
      |           ^~~
a.cc:32:17: error: 'p' was not declared in this scope
   32 |         if(dist[p.se.fi][p.se.se]!=p.fi)continue;
      |                 ^
a.cc:33:21: error: 'p' was not declared in this scope
   33 |         for(int i=0;p.se.se+c[p.se.fi]*i<=2450;i++){
      |                     ^
a.cc:33:29: error: 'c' was not declared in this scope
   33 |         for(int i=0;p.se.se+c[p.se.fi]*i<=2450;i++){
      |                             ^
a.cc:36:67: error: 'd' was not declared in this scope
   36 |                 if(dist[e.to][p.se.se+c[p.se.fi]*i-e.silver]>p.fi+d[p.se.fi]*i+e.cost){
      |                                                                   ^
a.cc:38:23: error: request for member 'push' in 'q', which is of non-class type 'int'
   38 |                     q.push({dist[e.to][p.se.se+c[p.se.fi]*i-e.silver],{e.to,p.se.se+c[p.se.fi]*i-e.silver}});
      |                       ^~~~
a.cc: In function 'int main()':
a.cc:45:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   45 |     cin>>n>>m>>s;
      |          ^
      |          yn
a.cc:45:13: error: 'm' was not declared in this scope
   45 |     cin>>n>>m>>s;
      |             ^
a.cc:45:16: error: 's' was not declared in this scope
   45 |     cin>>n>>m>>s;
      |                ^
a.cc:54:18: error: 'c' was not declared in this scope
   54 |     rep(i,n)cin>>c[i]>>d[i];
      |                  ^
a.cc:54:24: error: 'd' was not declared in this scope
   54 |     rep(i,n)cin>>c[i]>>d[i];
      |                        ^
a.cc:59:34: error: 'dist' was not declared in this scope
   59 |             rep(j,2451)chmin(ans,dist[i][j]);
      |                                  ^~~~