Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <numeric>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define rep(i, init, n) for(int i = init; i <(int)(n); i++)

struct data{
    ll v;
    ll m;
    ll t;
    data(ll v, ll m, ll t):v(v), m(m), t(t){}
    bool operator<(const data& a) const{
        return t > a.t;
    }
};
struct edge{
    ll to, rate, time;
    edge(ll to, ll rate, ll time):to(to), rate(rate), time(time){}
};

int main() {
    ll N, M, S;
    cin >> N >> M >> S;
    ll tmp1, tmp2, a, b;
    vector<vector<edge>> e(N);
    REP(i, M){
        cin >> tmp1 >> tmp2 >> a >> b;
        tmp1--;
        tmp2--;
        e[tmp1].push_back(edge(tmp2, a, b));
        e[tmp2].push_back(edge(tmp1, a, b));
    }
        //cout << "Hi" << endl;
    vector<P> convert(N);
    REP(i, N){
        cin >> a >> b;
        convert[i] = P(a, b);
    }
    vector<vector<ll>> dp(51, vector<ll>(2505, INF));
    priority_queue<data> q;
    q.push(data(0, min(2504, S), 0));

    while(!q.empty()){
        data hoge = q.top();
        q.pop();
        if (hoge.t < dp[hoge.v][hoge.m]){
            dp[hoge.v][hoge.m] = hoge.t;
            
            if (hoge.m + convert[hoge.v].first < 2501)q.push(data(hoge.v, hoge.m + convert[hoge.v].first, hoge.t + convert[hoge.v].second));
            for(auto e: e[hoge.v]){
                if (hoge.m - e.rate >= 0 && hoge.t + e.time < dp[e.to][hoge.m - e.rate]) q.push(data(e.to, hoge.m - e.rate, hoge.t + e.time));
            }
        }
    }

    REP(i, N-1){
        ll tmp = INF;
        REP(j, 2505) tmp = min(tmp, dp[i+1][j]);
        cout << tmp << endl;
    }



    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:24: error: template argument 1 is invalid
   64 |     priority_queue<data> q;
      |                        ^
a.cc:64:24: error: template argument 2 is invalid
a.cc:64:24: error: template argument 3 is invalid
a.cc:65:7: error: request for member 'push' in 'q', which is of non-class type 'int'
   65 |     q.push(data(0, min(2504, S), 0));
      |       ^~~~
a.cc:65:12: error: reference to 'data' is ambiguous
   65 |     q.push(data(0, min(2504, S), 0));
      |            ^~~~
In file included from /usr/include/c++/14/string:53,
                 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/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:31:8: note:                 'struct data'
   31 | struct data{
      |        ^~~~
a.cc:67:14: error: request for member 'empty' in 'q', which is of non-class type 'int'
   67 |     while(!q.empty()){
      |              ^~~~~
a.cc:68:9: error: reference to 'data' is ambiguous
   68 |         data hoge = q.top();
      |         ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:31:8: note:                 'struct data'
   31 | struct data{
      |        ^~~~
a.cc:69:11: error: request for member 'pop' in 'q', which is of non-class type 'int'
   69 |         q.pop();
      |           ^~~
a.cc:70:13: error: 'hoge' was not declared in this scope
   70 |         if (hoge.t < dp[hoge.v][hoge.m]){
      |             ^~~~
a.cc:73:57: error: request for member 'push' in 'q', which is of non-class type 'int'
   73 |             if (hoge.m + convert[hoge.v].first < 2501)q.push(data(hoge.v, hoge.m + convert[hoge.v].first, hoge.t + convert[hoge.v].second));
      |                                                         ^~~~
a.cc:73:62: error: reference to 'data' is ambiguous
   73 |             if (hoge.m + convert[hoge.v].first < 2501)q.push(data(hoge.v, hoge.m + convert[hoge.v].first, hoge.t + convert[hoge.v].second));
      |                                                              ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:31:8: note:                 'struct data'
   31 | struct data{
      |        ^~~~
a.cc:75:92: error: request for member 'push' in 'q', which is of non-class type 'int'
   75 |                 if (hoge.m - e.rate >= 0 && hoge.t + e.time < dp[e.to][hoge.m - e.rate]) q.push(data(e.to, hoge.m - e.rate, hoge.t + e.time));
      |                                                                                            ^~~~
a.cc:75:97: error: reference to 'data' is ambiguous
   75 |                 if (hoge.m - e.rate >= 0 && hoge.t + e.time < dp[e.to][hoge.m - e.rate]) q.push(data(e.to, hoge.m - e.rate, hoge.t + e.time));
      |                                                                                                 ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:31:8: note:                 'struct data'
   31 | struct data{
      |        ^~~~