Language: C++

#include <bits/stdc++.h>
#define ll long long
#define mem( f, x ) memset( f, x, sizeof(f) )
#define pii pair<int,int>
#define fi first
#define se second
#define mk(x,y) make_pair(x,y)
#define pk push_back
using namespace std;
const int M = 305;
const int N = 105;
const ll INF = 0x3f3f3f3f3f3f;
int m, n, s;
int head[N], cnt;
ll dis[N][2555];
ll c[N], d[N];

struct eg{
    int to, pre;
    int a, b;
    eg( ):to(0), pre(0), a(0), b(0){ }
    eg( int tt, int pp, int aa, int bb ){
        to = tt, pre = pp, a = aa, b = bb;
    }
}e[M];

struct node{
    int x, c, d;
    node():x(0), c(0), d(0){ }
    node( int xx, int cc, int dd ):x(xx), c(cc), d(dd){}
    friend bool operator<( node p1, node p2 ){
        if( p1.d == p2.d )
            return p1.c < p2.c;
        return p1.d > p2.d;
    }
};

void add( int x, int y, int a, int b ){
    e[++cnt] = eg( y, head[x], a, b );
    head[x] = cnt;
}

void Bfs( ){
    dis[1][s] = 0;
    priority_queue<node> pq;
    node cur, nxt;
    cur = node( 1, s, 0 );
    pq.push( cur );
    while( !pq.empty() ){
        cur = pq.top();
        pq.pop();
        int x = cur.x;
        //cout << "cur_x: " << x << endl;
        for( int i = head[x]; i; i = e[i].pre ){
            int to = e[i].to;
            if( cur.c < e[i].a ) continue;
            nxt = node( to, cur.c-e[i].a, dis[x][cur.c]+e[i].b );
            if( dis[to][cur.c-e[i].a] > nxt.d ){
                dis[to][cur.c-e[i].a] = nxt.d;
                pq.push( nxt );
            }
        }
        ll mi = min( cur.c+c[x], 2500 );
        if( dis[x][mi] > dis[x][cur.c]+d[x] ){
            dis[x][mi] = dis[x][cur.c]+d[x];
            pq.push( node( x, mi, dis[x][mi] ) );
        }

    }
}

void init( ){
    mem( dis, INF );
    for( int i = 0; i <= n; i++ )
        head[i] = 0;
    cnt = 0;
}

int main( ){
    while( scanf( "%d %d %d", &n, &m, &s ) != EOF ){
        init( );
        int x, y, a, b;
        for( int i = 0; i < m; i++ ){
            scanf( "%d %d %d %d", &x, &y, &a, &b );
            add( x, y, a, b );
            add( y, x, a, b );
        }
        for( int i = 1; i <= n; i++ )
            scanf( "%d %d", c+i, d+i );
        Bfs( );
        for( int i = 2; i <= n; i++ ){
            ll ans = INF;
            for( int j = 0; j <= 2500; j++ )
                ans = min( ans, dis[i][j] );
            printf( "%lld\n", ans );
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'void Bfs()':
a.cc:63:20: error: no matching function for call to 'min(long long int, int)'
   63 |         ll mi = min( cur.c+c[x], 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:63:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   63 |         ll mi = min( cur.c+c[x], 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:63:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   63 |         ll mi = min( cur.c+c[x], 2500 );
      |                 ~~~^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'void init()':
a.cc:73:15: warning: overflow in conversion from 'long long int' to 'int' changes value from '69540876599103' to '1061109567' [-Woverflow]
   73 |     mem( dis, INF );
      |               ^~~
a.cc:3:32: note: in definition of macro 'mem'
    3 | #define mem( f, x ) memset( f, x, sizeof(f) )
      |                                ^