Language: C++

#include <bits/stdc++.h>
using namespace std;
#define INF_LL 1000000000000000LL
#define INF 200000000
#define MOD 1000000007
#define ll long long
#define all(x) x.begin(), x.end()
#define REP(i, a, b) for(int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
// typedef float double;
// typedef priority_queue prique;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<P> vp;
typedef vector<ll> vl;
typedef vector<vi> matrix;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int sign[2] = {1, -1};
template <class T> bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}

ll modpow(ll a, ll b, ll m) {
    if(b == 0)
        return 1;
    ll t = modpow(a, b / 2, m);
    if(b & 1) {
        return (t * t % m) * a % m;
    } else {
        return t * t % m;
    }
}
struct edge {
    int to;
    ll cost;
    edge(int t, ll c) { to = t, cost = c; }
};

#define MAX_S 5000

vector<ll> dijkstra(vector<vector<edge>> &g, int start, int n) {
    priority_queue<P, vector<P>, greater<P>> que;
    vector<ll> dist(n, INF_LL);
    dist[start] = 0;
    que.push(P(0, start));
    while(!que.empty()) {
        P p = que.top();
        que.pop();
        int v = p.second;
        if(dist[v] < p.first)
            continue;
        rep(i, (int)g[v].size()) {
            edge e = g[v][i];
            if(dist[e.to] > dist[v] + e.cost) {
                dist[e.to] = dist[v] + e.cost;
                que.push(P(dist[e.to], e.to));
            }
        }
    }
    return dist;
}

int main() {
    int n, m, s;
    cin >> n >> m >> s;
    vector<vector<edge>> g(n * (MAX_S + 1));
    rep(i, m) {
        int u, v, a;
        ll b;
        cin >> u >> v >> a >> b;
        REP(j, a, MAX_S + 1) {
            g[(u - 1) * (MAX_S + 1) + j].push_back(
                edge((v - 1) * (MAX_S + 1) + j - a, b));
            g[(v - 1) * (MAX_S + 1) + j].push_back(
                edge((u - 1) * (MAX_S + 1) + j - a, b));
        }
    }
    rep(i, n) {
        ll c, d;
        cin >> c >> d;
        rep(j, MAX_S) {
            g[i * (MAX_S + 1) + j].push_back(
                edge(i * (MAX_S + 1) + min(j + c, MAX_S), d));
        }
    }
    vl d(n * (MAX_S + 1));
    d = dijkstra(g, min((ll)s, MAX_S), n * (MAX_S + 1));
    REP(j, 1, n) {
        ll ans = INF_LL;
        rep(i, MAX_S + 1) { chmin(ans, d[j * (MAX_S + 1) + i]); }
        cout << ans << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:96:43: error: no matching function for call to 'min(long long int, int)'
   96 |                 edge(i * (MAX_S + 1) + min(j + c, MAX_S), 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:96:43: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   96 |                 edge(i * (MAX_S + 1) + min(j + c, MAX_S), 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:96:43: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   96 |                 edge(i * (MAX_S + 1) + min(j + c, MAX_S), d));
      |                                        ~~~^~~~~~~~~~~~~~
a.cc:100:24: error: no matching function for call to 'min(long long int, int)'
  100 |     d = dijkstra(g, min((ll)s, MAX_S), n * (MAX_S + 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:100:24: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
  100 |     d = dijkstra(g, min((ll)s, MAX_S), n * (MAX_S + 1));
      |                     ~~~^~~~~~~~~~~~~~
/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
/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:100:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
  100 |     d = dijkstra(g, min((ll)s, MAX_S), n * (MAX_S + 1));
      |                     ~~~^~~~~~~~~~~~~~