Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<cassert>
#include<numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
const int INF = 1001001001;
const long long LINF = 1001002003004005006ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<ll,int> P;

struct Edge {
  int to, a, b;
  Edge(int to, int a, int b):to(to),a(a),b(b) {}
};

const int MAX_C = 2505;

vector<Edge> to[55];
vector<P> change(55);

int main(){
  int n,m,s;
  cin >> n >> m >> s;
  rep(i,m){
    int u,v,a,b;
    cin >> u >> v >> a >> b;
    u--,v--;
    to[u].emplace_back(v,a,b);
    to[v].emplace_back(u,a,b);
  }
  rep(i,n){
    int c,d;
    cin >> c >> d;
    change[i]=pair(c,d);
  }
  auto toID = [&](int v,int c){
    return v*MAX_C+c;
  };
  priority_queue<P,vector<P>,greater<P>> pq;
  vector<ll> dist(MAX_C*n,LINF);
  auto push = [&](int v,int c,ll x){
    if(c<0)return;
    int id = toID(v,c);
    if(dist[id]<=x)return;
    dist[id]=x;
    pq.emplace(x,id);
  };
  chmin(s,MAX_C-1);
  push(0,s,0);
  while(!pq.empty()){
    ll d = pq.top().first;
    int id = pq.top().second;
    pq.pop();
    if(dist[id]!=d)continue;
    int v = id/MAX_C;
    int c = id%MAX_C;
    for(auto e:to[v]){
      push(e.to,c-e.a,d+e.b);
    }
    push(v,min(c+change[v].first,MAX_C-1),d+change[v].second);
  }
  for(int i=1;i<n;i++){
    ll ans = LINF;
    rep(j,MAX_C)chmin(ans,dist[toID(i,j)]);
    cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:15: error: no matching function for call to 'min(long long int, int)'
   73 |     push(v,min(c+change[v].first,MAX_C-1),d+change[v].second);
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:73:15: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   73 |     push(v,min(c+change[v].first,MAX_C-1),d+change[v].second);
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:73:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   73 |     push(v,min(c+change[v].first,MAX_C-1),d+change[v].second);
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~