Language: C++

#include <bits/stdc++.h>
using namespace std;
#define SELECTER(_1, _2, _3, SELECT, ...) SELECT
#define REP1(i, n) for(int (i)=0; (i)<(n); (i)++)
#define REP2(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define REP(...) SELECTER(__VA_ARGS__, REP2, REP1,) (__VA_ARGS__)
#define MOD 1'000'000'007

template <class T> ostream& operator<<(ostream& os, const vector<T>& v){ os << "{"; for(size_t i=0; i<v.size(); i++) os << v[i] << (i+1==v.size() ? "" : ", "); os << "}"; return os; }
template <class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p){ return os << "{" << p.first << ", " << p.second << "}"; }

long long N, M, S;
vector<vector<tuple<long long, long long, long long>>> G;
vector<pair<long long, long long>> CD;
long long dp[50][2555];

int main(){
    cin >> N >> M >> S;
    S = min(S, 2500LL);
    G.resize(N);
    CD.resize(N);
    REP(i, M){
        long long U, V, A, B;
        cin >> U >> V >> A >> B;
        U--; V--;
        G[U].push_back(make_tuple(V, A, B));
        G[V].push_back(make_tuple(U, A, B));
    }
    REP(i, N){
        long long C, D;
        cin >> C >> D;
        CD[i] = make_pair(C, D);
    }
    REP(i, 50) REP(j, 2555) dp[i][j] = 1LL<<60;
    dp[0][S] = 0;

    priority_queue<tuple<long long, long long, long long>, vector<tuple<long long, long long, long long>>, greater<tuple<long long, long long, long long>>> pq;
    pq.push(make_tuple(0, 0, S));

    while(!pq.empty()){
        long long d, cur, s;
        tie(d, cur, s) = pq.top();
        //cerr << d << " " << cur << " " << s << endl;
        pq.pop();
        for(auto x : G[cur]){
            long long nxt, a, b;
            tie(nxt, a, b) = x;
            if(a <= s){
                if(dp[cur][s]+b < dp[nxt][s-a]){
                    dp[nxt][s-a] = dp[cur][s] + b;
                    pq.push(make_tuple(dp[nxt][s-a], nxt, s-a));
                }
            }
        }
        long long cc = CD[cur].first, dd = CD[cur].second;
        long long ss = s + cc;
        ss = min(ss, 2500);
        if(dp[cur][s]+dd < dp[cur][ss]){
            dp[cur][ss] = dp[cur][s]+dd;
            pq.push(make_tuple(dp[cur][ss], cur, ss));
        }
    }
    for(int i=1; i<N; i++){
        long long ans = 1LL<<60;
        for(int j=0; j<=2500; j++)
            ans = min(ans, dp[i][j]);
        cout << ans << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:17: error: no matching function for call to 'min(long long int&, int)'
   57 |         ss = min(ss, 2500);
      |              ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:57:17: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   57 |         ss = min(ss, 2500);
      |              ~~~^~~~~~~~~~
/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:
/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:57:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   57 |         ss = min(ss, 2500);
      |              ~~~^~~~~~~~~~