Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i = (int)(j);i <= (int)(k);i ++)
#define debug(x) cerr<<#x<<":"<<x<<endl
const int maxn=(int)1e6+5;
typedef long long ll;

struct edge{
    ll to,a,b;
};
struct data{
    ll v,s,t;
    bool operator < (const data & a)const{return t>a.t;}
};

const ll  MAXN=50,MAXS=MAXN*50,INF=1e12;
ll dp[MAXN+1][MAXS+1];
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    ll n,m,s;cin>>n>>m>>s;
    vector<edge> E[MAXN+1];
    rep(i,1,m){
        int u,v,a,b;
        cin>>u>>v>>a>>b;
        E[u].push_back((edge){v,a,b});
        E[v].push_back((edge){u,a,b});
    }
    vector<int> c(n+1),d(n+1);
    rep(i,1,n){
        cin>>c[i]>>d[i];
    }
    s=min(s,MAXS);
    rep(i,1,n)rep(j,0,MAXS)dp[i][j]=INF;dp[1][s]=0;
    priority_queue<data> Q;
    Q.push((data){1,s,0});
    while(!Q.empty()){
        data dt=Q.top();Q.pop();
        //debug(dt.v),debug(dt.s),debug(dt.t);
        //if(dt.s<0)continue;
        if(dt.t>dp[dt.v][dt.s])continue;
        //change
        ll ns=min(dt.s+c[dt.v],MAXS);
        ll nt=dt.t+d[dt.v];//?dp[dt.v][dt.s]+d[dt.v]
        if(dp[dt.v][ns]>nt){
            dp[dt.v][ns]=nt;
            Q.push((data){dt.v,ns,nt});
        }
        // trans
       
        for(auto e:E[dt.v]){
            ns=dt.s-e.a;
            nt=dp[dt.v][dt.s]+e.b;//?dt.t+e.b
            if(ns>=0 and dp[e.to][ns]>nt){
                dp[e.to][ns]=nt;
                Q.push((data){e.to,ns,nt});
            }
        }
    }
    rep(i,2,n){
        ll ans=INF;
        rep(j,0,MAXS){
            ans=min(ans,dp[i][j]);
            
        }
        cout<<ans<<endl;
    }
}
/* 
dp[i][j] min time takes from 1 to node i, have j coin with me.
dp[i][j]=dp[k][j-cost]
 */

Compiler output:
a.cc: In function 'int main()':
a.cc:34:24: error: template argument 1 is invalid
   34 |     priority_queue<data> Q;
      |                        ^
a.cc:34:24: error: template argument 2 is invalid
a.cc:34:24: error: template argument 3 is invalid
a.cc:35:7: error: request for member 'push' in 'Q', which is of non-class type 'int'
   35 |     Q.push((data){1,s,0});
      |       ^~~~
a.cc:35:13: error: reference to 'data' is ambiguous
   35 |     Q.push((data){1,s,0});
      |             ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 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:11:8: note:                 'struct data'
   11 | struct data{
      |        ^~~~
a.cc:36:14: error: request for member 'empty' in 'Q', which is of non-class type 'int'
   36 |     while(!Q.empty()){
      |              ^~~~~
a.cc:37:9: error: reference to 'data' is ambiguous
   37 |         data dt=Q.top();Q.pop();
      |         ^~~~
/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:11:8: note:                 'struct data'
   11 | struct data{
      |        ^~~~
a.cc:37:27: error: request for member 'pop' in 'Q', which is of non-class type 'int'
   37 |         data dt=Q.top();Q.pop();
      |                           ^~~
a.cc:40:12: error: 'dt' was not declared in this scope; did you mean 'd'?
   40 |         if(dt.t>dp[dt.v][dt.s])continue;
      |            ^~
      |            d
a.cc:42:19: error: 'dt' was not declared in this scope; did you mean 'd'?
   42 |         ll ns=min(dt.s+c[dt.v],MAXS);
      |                   ^~
      |                   d
a.cc:46:15: error: request for member 'push' in 'Q', which is of non-class type 'int'
   46 |             Q.push((data){dt.v,ns,nt});
      |               ^~~~
a.cc:46:21: error: reference to 'data' is ambiguous
   46 |             Q.push((data){dt.v,ns,nt});
      |                     ^~~~
/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:11:8: note:                 'struct data'
   11 | struct data{
      |        ^~~~
a.cc:55:19: error: request for member 'push' in 'Q', which is of non-class type 'int'
   55 |                 Q.push((data){e.to,ns,nt});
      |                   ^~~~
a.cc:55:25: error: reference to 'data' is ambiguous
   55 |                 Q.push((data){e.to,ns,nt});
      |                         ^~~~
/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:11:8: note:                 'struct data'
   11 | struct data{
      |        ^~~~