Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef int64_t Int;
typedef pair<Int, Int> p;
const Int INF = 1e18;

struct edge{Int to, t;};

Int N, M, S;

// 頂点vで銀貨c枚持っている状態を頂点 v*2501+c とする 
vector<vector<edge>> G(51*2501);
vector<Int> dist(51*2501, INF);

void dijkstra(int s){
    // first:最短距離 second:頂点番号
    priority_queue<p, vector<p>, greater<p>> q;
    dist[s] = 0;
    q.push(p(0, s));

    while (!q.empty()){
        int cur_d = q.top().first;
        int cur_v = q.top().second;
        q.pop();

        if (cur_d > dist[cur_v]) continue;

        for (int i = 0; i < G[cur_v].size(); i++){
            edge e = G[cur_v][i];
            if (dist[cur_v] + e.t < dist[e.to]){
                dist[e.to] = dist[cur_v] + e.t;
                q.push(p(dist[e.to], e.to));
            }
        }
    }
}


int main(){
    cin >> N >> M >> S;
    if(S > 2500) S = 2500;

    rep(i,M){
        int u, v; Int a, b;
        cin >> u >> v >> a >> b;
        u--; v--;

        for(int j=a; j<=2500; j++){
            G[u*2501+j].push_back(edge{v*2501+(j-a),b});
            G[v*2501+j].push_back(edge{u*2501+(j-a),b});
        }
    }

    
    rep(i,N){
        Int c, d; cin >> c >> d;
        rep(j,2500){
            G[i*2501+j].push_back(edge{i*2501 + min(j+c,2500LL),d});
        }
    }

    dijkstra(S);

    rep1(i,N-1){
        Int ans = INF;
        rep(j,2501){
            ans = min(ans, dist[i*2501+j]);
        }
        cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:52: error: no matching function for call to 'min(Int, long long int)'
   60 |             G[i*2501+j].push_back(edge{i*2501 + min(j+c,2500LL),d});
      |                                                 ~~~^~~~~~~~~~~~
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:60:52: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   60 |             G[i*2501+j].push_back(edge{i*2501 + min(j+c,2500LL),d});
      |                                                 ~~~^~~~~~~~~~~~
/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:60:52: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   60 |             G[i*2501+j].push_back(edge{i*2501 + min(j+c,2500LL),d});
      |                                                 ~~~^~~~~~~~~~~~