criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <bits/stdc++.h>
using namespace std;

struct edge {
  long long time;
  long long cost;
  int to;
};
struct item {
  long long time;
  int cur;
  long long num;
  bool operator>(const item& rhs) const {
    return time > rhs.time;
  }
};
struct change {
  long long rate;
  long long time;
};

int main() {
  long long n, m, s;
  cin>>n>>m>>s;
  vector<edge> g[n];
  for (int i=0; i<m; i++) {
    int u, v, a, b;
    cin>>u>>v>>a>>b;
    --u;
    --v;
    g[u].push_back({b, a, v});
    g[v].push_back({b, a, u});
  }
  change c[n];
  for (int i=0; i<n; i++) cin>>c[i].rate>>c[i].time;

  long long d[n][2501];
  bool used[n][2501];
  for (int i=0; i<n; i++) {
    for (int j=0; j<2501; j++) {
      d[i][j] = 1e12;
      used[i][j] = false;
    }
  }
  s = min(s, 2500LL);
  priority_queue<item, vector<item>, greater<item>> pq;
  pq.push({0LL, 0, s});
  d[0][s] = 0;
  while (!pq.empty()) {
    auto top = pq.top();
    pq.pop();
    long long time = top.time;
    int cur = top.cur;
    long long num = top.num;
    if (used[cur][num]) continue;
    used[cur][num] = true;
    long long time2 = time + c[cur].time;
    long long num2 = num + c[cur].rate;
    if (num2 <= 2500 && !used[cur][num2]) {
      if (time2 < d[cur][num2]) {
        d[cur][num2] = time2;
        pq.push({time2, cur, num2});
      }
    }
    for (auto e: g[cur]) {
      long long e_time = e.time;
      long long e_cost = e.cost;
      int e_to = e.to;
      long long to_num = num - e_cost;
      long long to_time = time + e_time;
      if (to_num < 0 || used[e_to][to_num]) continue;
      if (to_time < d[e_to][to_num]) {
        d[e_to][to_num] = to_time;
        pq.push({to_time, e_to, to_num});
      }
    }
  }
  for (int i=1; i<n; i++) {
    long long ans = 1e12;
    for (int j=0; j<2501; j++) {
      ans = min(d[i][j], ans);
    }
    cout<<ans<<endl;
  }
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include<set>
#include<math.h>

#define DIV 1000000007
using namespace std;
using ll = long long;

int main(void) {
	int N, M, S;
	cin >> N >> M >> S;

	vector < vector<pair<int, pair<ll, ll>>>> city(N + 1);
	for (int i = 0; i < M; i++) {
		int u, v;
		ll a, b;
		cin >> u >> v >> a >> b;
		city[u].push_back(make_pair(v, make_pair(-a, b)));
		city[v].push_back(make_pair(u, make_pair(-a, b)));
	}

	for (int i = 1; i <= N; i++) {
		ll c, d;
		cin >> c >> d;
		city[i].push_back(make_pair(i, make_pair(c, d)));
	}

	S = min(S, 2500);
	priority_queue<pair<ll, pair<int, int>>, vector<pair<ll, pair<int, int>>>, greater<pair<ll, pair<int, int>>>> pq;
	vector<vector<ll>> cost(N + 1, vector<ll>(2501, 1e15));
	vector<vector<bool>> visit(N + 1, vector<bool>(2501));
	pq.emplace(0, make_pair(1, S));
	cost[1][S] = 0;

	//cout << endl;
	while (!pq.empty()) {
		pair<ll, pair<int, int>> x = pq.top();
		pq.pop();
		visit[x.second.first][x.second.second] = true;

		//cout << x.second.first << " " << x.second.second << endl;
		for (auto edge : city[x.second.first]) {
			int to = edge.first, silver = min((ll)2500, x.second.second + edge.second.first);
			//cout << to << " " << silver << endl;
			if (silver < 0) continue;
			if (visit[to][silver]) continue;
			if (cost[to][silver] >cost[x.second.first][x.second.second] + edge.second.second) {
				cost[to][silver] = cost[x.second.first][x.second.second] + edge.second.second;

				pq.emplace(cost[to][silver], make_pair(to,silver));
			}

		}
	}

	for (int i = 2; i <= N; i++) {
		ll ans = 1e15;
		for (int j = 0; j <= 2500; j++) {
			ans = min(ans, cost[i][j]);
		}

		cout << ans << endl;
	}
}


Compiler output:
main.c:2:10: fatal error: bits/stdc++.h: No such file or directory
    2 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;

using P = pair<int, int>;
using Edge = pair<int, P>;

signed main() {
  int N, M, S;
  cin >> N >> M >> S;

  vector<vector<Edge>> graph(N);
  REP(i, M){
    int u, v, a, b;
    cin >> u >> v >> a >> b;
    u--; v--;
    graph[u].emplace_back(Edge(v, make_pair(a, b)));
    graph[v].emplace_back(Edge(u, make_pair(a, b)));
  }

  vector<int> c(N), d(N);
  REP(i, N) cin >> c[i] >> d[i];

  const int MAX = 2500;
  chmin(S, MAX);

  vector<vector<int>> dp(N, vector<int>(MAX+1, INF));
  dp[0][S] = 0;

  priority_queue<Edge, vector<Edge>, greater<Edge>> q;
  q.push({0, {0, S}});

  while(!q.empty()){
    auto p = q.top(); q.pop();
    int time = p.first;
    int v = p.second.first;
    int s = p.second.second;
    if(time >= dp[v][s]) continue;

    if(s+c[v] <= MAX){
      if(chmin(dp[v][s+c[v]], time+d[v])){
        q.push({time+d[v], {v, s+c[v]}});
      }
    }

    for(auto e : graph[v]){
      if(s < e.second.first) continue;
      if(chmin(dp[e.first][s-e.second.first], time+e.second.second)){
        q.push({time+e.second.second, {e.first, s-e.second.first}});
      }
    }
  }

  FOR(i, 1, N){
    int ret = INF;
    REP(j, MAX) chmin(ret, dp[i][j]);
    cout << ret << "\n";
  }

  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for(int (i) = (n); (i) >= 0; --(i))
#define FOR(i, n, m) for(int (i) = (n); (i) < (m); ++(i))

// constexpr int INF = 1e9;
constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9+7;
int maxs = 2500;

vector<ll> dijkstra(vector<vector<pair<int, ll>>> g, int s){
  int n = g.size();
  vector<ll> dist(n, INF);
  dist[s] = 0;
  priority_queue<pair<ll, int>, vector<pair<ll, int>>, greater<pair<ll, int>>> pq;
  pq.push({0, s});
  while(!pq.empty()){
    auto[d, v] = pq.top(); pq.pop();
    if(d > dist[v]) continue;
    for(auto e : g[v]){
      auto[nv, c] = e;
      if(dist[nv] > dist[v]+c){
        dist[nv] = dist[v]+c;
        pq.push({dist[nv], nv});
      }
    }
  }
  return dist;
}
int main(){
  int N, M, S;
  cin >> N >> M >> S;
  S = min(S, 2499);
  vector<vector<pair<int, ll>>> g(N*2500);
  REP(i, M){
    int U, V, A, B;
    cin >> U >> V >> A >> B;
    U--, V--;
    FOR(j, A, maxs){
      g[U*maxs+j].push_back({V*maxs+j-A, B});
      g[V*maxs+j].push_back({U*maxs+j-A, B});
    }
  }
  REP(i, N){
    int C, D;
    cin >> C >> D;
    REP(j, maxs-C){
      g[i*maxs+j].push_back({i*maxs+j+C, D});
    }
  }
  vector<ll> dist = dijkstra(g, S);
  vector<ll> ans(N, INF);
  REP(i, N){
    REP(j, 2500){
      ans[i] = min(ans[i], dist[i*maxs+j]);
    }
  }
  FOR(i, 1, N){
    cout << ans[i] << endl;
  }
  return 0;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
#define fo(i,a,b) for((i)=(a);i<=(b);i++)
#define rfo(i,a,b) for((i)=(a);i>=(b);i--)
#define inrange(x,y,z) (((x)>=(y))&&((x)<=(z)))
#define ALL(vec) ((vec).begin(),(vec).end())
#define SOR(vec) sort(ALL(vec))
#define UNI(vec) (vec).erase(unique(ALL(vec)),(vec).end())
#define par pair<int,pair<int,long long> > 
#define dat pair<long long,pair<int,int> > 
using namespace std;
int n,m,s,mx,ns,a;
long long u,v,t,nt,b,c[100],d[100];
vector<par> ga[60];
long long dp[60][2510],res;
bool vis[60][2510];
priority_queue<dat,vector<dat>,greater<dat> >q; 
dat tmp;
int main(){
	#ifdef FILIN
		#ifndef DavidDesktop
			freopen(FILIN,"r",stdin);
			freopen(FILOUT,"w",stdout);
		#endif
	#endif
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n>>m>>s;
  	mx=(n-1)*50;
	for(int i=1;i<=m;i++){
		cin>>u>>v>>a>>b;
		ga[u].push_back(make_pair(v,make_pair(a,b)));
		ga[v].push_back(make_pair(u,make_pair(a,b)));
	}
	for(int i=1;i<=n;i++)
		cin>>c[i]>>d[i];
	memset(dp,63,sizeof(dp));
	s=min(s,mx);
	dp[1][s]=0;
	q.push(make_pair(0,make_pair(1,s)));
	while(q.size()){
		tmp=q.top();
		q.pop();
		u=tmp.second.first;
		t=tmp.first;
		s=tmp.second.second;
		for(int i=0;i<ga[u].size();i++){
			if(s<ga[u][i].second.first) continue;
			v=ga[u][i].first;
			ns=s-ga[u][i].second.first;
			nt=ga[u][i].second.second;
			if(dp[v][ns]>dp[u][s]+nt){
				dp[v][ns]=dp[u][s]+nt;
				q.push(make_pair(dp[v][ns],make_pair(v,ns)));
			}
		}
		ns=s+c[u];
		ns=min(ns,mx);
		if(dp[u][ns]>dp[u][s]+d[u]){
			dp[u][ns]=dp[u][s]+d[u];
			q.push(make_pair(dp[u][ns],make_pair(u,ns)));
		}
	}
	for(int i=2;i<=n;i++){
		res=1e18;
		for(int j=0;j<=mx;j++){
			res=min(res,dp[i][j]);
		}
		cout<<res<<endl;
	}
	return 0;
}


Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class ETwoCurrencies {
public:
    vector<int> it, ic;
    vector<vector<tuple<int, int, int>>> G;

    void dfs(int v, int p) {

    }

    void solve(std::istream& cin, std::ostream& cout) {
        int N, M, S;
        cin >> N >> M >> S;
        G.resize(N);
        int sum = 0;
        REP(i, M) {
            int u, v, a, b;
            cin >> u >> v >> a >> b;
            u--, v--;
            G[u].emplace_back(v, a, b);
            G[v].emplace_back(u, a, b);
            sum += a;
        }
        vector<int> C(N), D(N);
        REP(i, N) {
            cin >> C[i] >> D[i];
        }

        if (S > sum) {
            S = sum;
        }
        priority_queue<pair<int, P>, vector<pair<int, P>>, greater<>> pq;
        vector<vector<int>> dist(N, vector<int>(sum + 1, INF));
        dist[0][S] = 0;
        pq.push({0, {0, S}});
        while (!pq.empty()) {
            auto[cost, vv] = pq.top();
            auto[from, money] = vv;
            pq.pop();
            if (dist[from][money] < cost) continue;
            for (auto v : G[from]) {
                auto[to, a, b] = v;
                if (money - a < 0) continue;
                if (cost + b < dist[to][money - a]) {
                    dist[to][money - a] = cost + b;
                    pq.push({dist[to][money - a], {to, money - a}});
                }
            }
            int newmoney = money + C[from];
            if (newmoney > sum) newmoney = sum;
            if (cost + D[from] < dist[from][newmoney]) {
                dist[from][newmoney] = cost + D[from];
                pq.push({dist[from][newmoney], {from, newmoney}});
            }
        }
        FOR(i, 1, N - 1) {
            int res = INF;
            FOR(j, 0, sum) {
                res = min(res, dist[i][j]);
            }
            cout << res << endl;
        }
    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    ETwoCurrencies solver;
    solver.solve(in, out);
    return 0;
}


Compiler output:
main.c:7:10: fatal error: iostream: No such file or directory
    7 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) fixed << setprecision(x)
//const ll p = 1e9 + 7;
//const ll p = 998244353;
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

vll dijkstra(ll n, vector<vector<vll>> &nx, ll start) {
	vll ret(n * 2501, inf);
	ret[start] = 0;
	queue<ll> task;
	task.push(start);
	priority_queue<vll, vector<vll>, greater<vll>> pq;
	while (task.size()) {
		while (task.size()) {
			ll x = task.front();
			task.pop();
			for (ll i = 0; i < nx[x].size(); i++) {
				vll v = nx[x][i];
				if (ret[v[1]] < inf) continue;
				pq.push({ret[x] + v[0], v[1]});
			}
		}
		while (pq.size() && ret[pq.top()[1]] < inf) pq.pop();
		if (pq.size()) {
			vll v = pq.top();
			pq.pop();
			ret[v[1]] = v[0];
			task.push(v[1]);
		}
	}
	return ret;
}

int main() {
	//ios::sync_with_stdio(false);
	//cin.tie(nullptr);

	ll n, m, s;
	cin >> n >> m >> s;
	s = min(s, 2500ll);

	//頂点aで銀貨b枚所持
	auto index = [&] (ll a, ll b) {return a + b * n;};

	vector<vector<vll>> nx(n * 2501, vector<vll>(0));
	for (ll i = 0; i < m; i++) {
		ll u, v, a, b;
		cin >> u >> v >> a >> b;
		u--;
		v--;
		for (ll j = a; j <= 2500; j++) {
			nx[index(u, j)].push_back({b, index(v, j - a)});
			nx[index(v, j)].push_back({b, index(u, j - a)});
		}
	}

	for (ll i = 0; i < n; i++) {
		ll c, d;
		cin >> c >> d;
		for (ll j = 0; j <= 2500 - c; j++) {
			nx[index(i, j)].push_back({d, index(i, j + c)});
		}
	}

	vll ans = dijkstra(n, nx, index(0, s));
	for (ll i = 1; i < n; i++) {
		ll x = inf;
		for (ll j = 0; j <= 2500; j++) {
			x = min(x, ans[index(i, j)]);
		}
		cout << x << endl;
	}
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
const int mod = 1000000007;
const int max_n = 200005;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
    ll n,m,s;cin >> n >>m >>s;if(s>=5010)s=5009;
    vvpl g(n*5010);
    rep(i,m){
        ll u,v,a,b;cin >> u >> v >>a >>b;u--;v--;
        rep(j,5010){
            if(j-a>=0){
                g[u*5010+j].pb({v*5010+j-a,b});
                g[v*5010+j].pb({u*5010+j-a,b});
            }
        }
    }
    rep(i,n){
        ll c,d;cin >> c >>d;
        rep(j,5010){
            if(j+c<5010)g[i*5010+j].pb({i*5010+j+c,d});
        }
    }
    vl d(n*5010,INF/10);
    pqueue(pl) que;
    que.push({0,s});
    d[s]=0;
    //ll cnt=0;
    while(!que.empty()){
        pl p=que.top();
        que.pop();
        ll v=p.se;
        if(d[v]<p.fi)continue;
        rep(i,g[v].size()){
            pl ed=g[v][i];
            if(d[ed.fi]>d[v]+ed.se){
                d[ed.fi]=d[v]+ed.se;
                que.push({d[ed.fi],ed.fi});
            }
        }
        //if(cnt<10){
            //rep(i,10)cout << d[i] <<" "<<d[i+5010] <<" "<< d[i+10020]<<endl;
            //cout <<endl;
        //}
        //cnt++;
    }
    rep(i,n-1){
        ll ans=INF;
        rep(j,5010){
            chmin(ans,d[(i+1)*5010+j]);
        }
        cout <<ans <<endl;
    }
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
using namespace std;
using lint = long long;
lint N, M, S;
typedef pair<lint, lint> P;
using edge = pair<lint, P>;
vector<vector<edge> > G;
vector<lint> c, d;
const lint MAX_MONEY = 2500, INF = 1e18;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void solve(){
	if(S >= MAX_MONEY) S = MAX_MONEY;
	vector<vector<lint> > dp(N, vector<lint> (MAX_MONEY + 10, INF));
	priority_queue<pair<lint, P>, vector<pair<lint, P> >, greater<pair<lint, P> > > que;
	dp[0][S] = 0;
	que.push(make_pair(0, P(0 ,S)));
	while(que.size()){
		auto p = que.top(); que.pop();
		lint time = p.first, now = p.second.first, money = p.second.second;
		if(time > dp[now][money]) continue;

		if(money + c[now] <= MAX_MONEY){
			lint ns = money + c[now];
			lint ntime = time + d[now];
			if(chmin(dp[now][ns], ntime)) que.push(make_pair(ntime, P(now, ns)));
		}

		for(auto e : G[now]){
			if(money < e.second.first) continue;
			lint nv = e.first;
			lint ns = money - e.second.first;
			lint ntime = time + e.second.second;
			if(chmin(dp[nv][ns], ntime)) que.push(make_pair(ntime, P(nv, ns)));
		}
	}

	for(lint v = 1; v < N; v++){
		lint ans = INF;
		for(lint s = 0; s <= MAX_MONEY; s++) ans = min(ans, dp[v][s]);
		cout << ans << endl;
	}
}

signed main(){
	cin >> N >> M >> S;
	c.resize(N); d.resize(N); G.resize(N);
	for(lint i = 0; i < M; i++){
		lint u, v, a, b; cin >> u >> v >> a >> b; --u; --v;
		G[u].push_back(edge(v, P(a, b)));
		G[v].push_back(edge(u, P(a, b)));
	}
	for(lint i = 0; i < N; i++) cin >> c[i] >> d[i];
	solve();
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
using namespace std;
long long n,m,dp[53][2503],s;
vector<pair<long long,pair<long long,long long> > >v[53];
int main(){
	scanf("%lld%lld%lld",&n,&m,&s);
	s=min(s,n*50);
	while(m--){
		long long x,y,a,b;scanf("%lld%lld%lld%lld",&x,&y,&a,&b);
		v[x-1].push_back(make_pair(y-1,make_pair(-a,b)));
		v[y-1].push_back(make_pair(x-1,make_pair(-a,b)));
	}
	memset(dp,31,sizeof(dp));
	for(long long i=0;i<n;i++)
	{
		long long c,d;cin>>c>>d;
		v[i].push_back(make_pair(i,make_pair(c,d)));
	}
	priority_queue<pair<long long,pair<long long,long long> > >Q;
	Q.push(make_pair(0,make_pair(0,s)));
	dp[0][s]=0;
	while(Q.size()){
		long long tm=-Q.top().first,ct=Q.top().second.first,cn=Q.top().second.second;Q.pop();
		for(long long i=0;i<v[ct].size();i++){
			long long nct=v[ct][i].first,ntm=tm-v[ct][i].second.second,ncoi=v[ct][i].second.first+cn;
			if(ncoi<0)continue;
			if(ncoi>n*50)continue;
			if(dp[nct][ncoi]<=-ntm)continue;
			dp[nct][ncoi]=-ntm; 
			Q.push(make_pair(-ntm,make_pair(nct,ncoi)));
		}
	}
	for(long long i=1;i<n;i++){
		long long ans=LONG_LONG_MAX;
		for(long long j=0;j<=n*50;j++)ans=min(ans,dp[i][j]);
		cout<<ans<<endl;
	}
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
#define repitr(itr,a) for(auto itr=a.begin();itr!=a.end();++itr)
const int MOD=1e9+7;
const int INF=1e9;


int main() {
    ios_base::sync_with_stdio(false);

    int n,m,s;
    cin >> n >> m >> s;
    vector<vector<ll>> money(n,vector<ll>(n,INF)),tim(n,vector<ll>(n,INF));
    rep(i,m) {
        int u,v,a,b;
        cin >> u >> v >> a >> b;
        money[u-1][v-1]=a;
        money[v-1][u-1]=a;
        tim[u-1][v-1]=b;
        tim[v-1][u-1]=b;
    }
    vector<int> c(n),d(n);
    rep(i,n) cin >> c[i] >> d[i];
    vector<ll> cost(n,-1),mcost(n,-1);
    priority_queue<tuple<ll,int,ll>,vector<tuple<ll,int,ll>>, greater<tuple<ll,int,ll>>> pq;
    pq.push(make_tuple(0,0,s));
    int cnt=0;
    while (cnt<n) {
        tuple<ll,int,ll> now=pq.top();
        pq.pop();
        ll ti=get<0>(now);
        int pos=get<1>(now);
        ll mon=get<2>(now);
        if (mon<=mcost[pos]) continue;
        mcost[pos]=mon;
        if (cost[pos]==-1) {
            cost[pos]=ti;
            ++cnt;
        }
        rep(next,n) {
            if (tim[pos][next]!=INF && mon>=money[pos][next]) {
                pq.push(make_tuple(ti+tim[pos][next],next,mon-money[pos][next]));
            }
        }
        if (mon<2500) pq.push(make_tuple(ti+d[pos],pos,mon+c[pos]));
    }
    repr(i,1,n) cout << cost[i] << endl;

    return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
  
#define int long long 
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pii pair<int,int>

const int inf = 1e16;

const int N = 51;
vector<pair<int,pii> > g[N];
int n,m,s;
int c[N];
int d[N];
int dp[N][(N*N)];

void solve()
{
   cin >> n >> m >> s;
    
   int u,v,w,x;
    
   f(i,m)
   {
       cin >> u >> v >> w >> x;
       u--; v--;
       
       g[u].pb({v,{w,x}});
       g[v].pb({u,{w,x}});
   }
    
   f(i,n) cin >> c[i] >> d[i];
    
   build(); 
    
   if(s >= 2500) s = 2500;
    
   f(i,n) f(j,2501) dp[i][j] = inf; 
   dp[0][s] = 0;
    
  f(go,n+1)  
   for(int i=0;i<n;i++)
   {
       for(auto x : g[i])
           for(int j=0;j<=2500;j++)
       {
         if(j - x.S.F >= 0)  
           dp[i][j - x.S.F] = min(dp[i][j - x.S.F], dp[x.F][j] + x.S.S);
       }
      
       for(int j=0;j<=2500;j++)
       {
           if(j - c[i] >= 0)
           {
                dp[i][j] = min(dp[i][j],dp[i][j-c[i]] + d[i]);
           }
       }
       
   }
    
    
   for(int i=1;i<n;i++)
   {
       int res = inf;
       
       for(int j=0;j<=2500;j++) res = min(res,dp[i][j]);
       
       cout << res << '\n';
   }
}

signed main()
{
    fast;
    solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:38:4: error: 'build' was not declared in this scope
   38 |    build();
      |    ^~~~~
Language: C

#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << endl; exit(0); }
inline void no() { cout << "No" << endl; exit(0); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { x = max(x, y); }
template <typename T> inline void amin(T &x, T y) { x = min(x, y); }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

struct Edge {
  int to, cost, time;
  Edge(int to, int cost, int time) : to(to), cost(cost), time(time) {}
};

i64 dp[50][2551];

void solve() {
  int n, m, s;
  cin >> n >> m >> s;
  amin(s, 2500);
  vector<vector<Edge>> g(n);
  rep(i, m) {
    int u, v, a, b;
    cin >> u >> v >> a >> b;
    u--, v--;
    g[u].emplace_back(v, a, b);
    g[v].emplace_back(u, a, b);
  }
  vi32 cs(n), ds(n);
  rep(i, n) {
    int c, d;
    cin >> c >> d;
    cs[i] = c, ds[i] = d;
  }
  rep(i, 50) repc(j, 2550) dp[i][j] = 1e18;
  pqasc<tuple<i64, int, int>> q;
  q.emplace(0, s, 0);
  while (sz(q)) {
    i64 t;
    int s, u;
    tie(t, s, u) = q.top(), q.pop();
    if (dp[u][s] != 1e18) continue;
    dp[u][s] = t;
    if (s + cs[u] <= 2550 && dp[u][s + cs[u]] == 1e18) {
      q.emplace(t + ds[u], s + cs[u], u);
    }
    each(e, g[u]) {
      if (s - e.cost < 0) continue;
      if (dp[e.to][s - e.cost] != 1e18) continue;
      q.emplace(t + e.time, s - e.cost, e.to);
    }
  }
  reps(i, n - 1) {
    i64 ans = 1e18;
    repc(j, 2550) amin(ans, dp[i][j]);
    cout << ans << endl;
  }
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<ll,ll> P;
constexpr ll INF = (1LL << 55);

int main(){ 
  int n, m, s;
  cin >> n >> m >> s;
  vector<vector<pair<int,P>>> g(n);
  rep(i,m) {
    int u, v, a, b;
    cin >> u >> v >> a >> b;
    u--; v--;
    g[u].emplace_back(make_pair(v, make_pair(-a, b)));
    g[v].emplace_back(make_pair(u, make_pair(-a, b)));
  }

  vector<ll> c(n), d(n);
  rep(i,n) cin >> c[i] >> d[i];
  const int CMAX = m * 50;
  s = min(s, CMAX);
  for (int i = 0; i < n; i++) {
    vector<ll> time(CMAX + 1, -1);
    for (int j = 1; c[i] * j <= CMAX; j++) {
      time[j] = d[i] * j; 
    } 
    for (auto e : g[i]) {
      int v = e.first;
      ll a = e.second.first, b = e.second.second;
      for (int j = 1; c[i] * j <= CMAX; j++) {
        g[i].emplace_back(make_pair(v, make_pair(c[i] * j + a, time[j] + b)));
      }
    }
  }

  auto dijkstra = [&](int first = 0){
    vector<vector<ll>> dp(n, vector<ll>(CMAX + 1,INF));
    priority_queue<pair<ll, pair<int,int>>, vector<pair<ll, pair<int,int>>>, greater<pair<ll, pair<int,int>>>> que;
    dp[first][s] = 0;
    que.push(make_pair(0, make_pair(first, s)));
    while (!que.empty()) {
      auto p = que.top();
      que.pop();
      int u = p.second.first;
      int now = p.second.second;
      if (dp[u][now] < p.first) continue;
      for (auto e : g[u]) {
        int v = e.first;
        int next = now + e.second.first;
        ll cost = e.second.second;
        if (next < 0 || next > CMAX) continue;
        if (dp[v][next] > dp[u][now] + cost) {
          dp[v][next] = dp[u][now] + cost;
          que.push(make_pair(dp[v][next], make_pair(v, next)));
        }
      }
    }
    return dp;
  };
  auto res = dijkstra();
  for (int i = 1; i < n; i++) {
    ll ans = INF;
    for (int j = 0; j <= CMAX; j++) {
      ans = min(ans, res[i][j]);
    }
    cout << ans << endl;
  }
  return 0;
} 

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
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 tuple<Int, Int,Int> T;
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;
        for(int j=0; j+c<=2500; j++){
            G[i*2501+j].push_back(edge{i*2501+(j+c),d});
        }
    }

    vector<Int> ans(51, INF);

    dijkstra(S);

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

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>

using namespace std;
using ll = long long;
using P = pair<int,int>;
int MAX = 2500;

vector<vector<P>> hens(55), hen(55 * MAX);
vector<int> sil(100), tim(100);
vector<int> c(55), d(55);//銀貨のレート　時間

int value(int i, int s) {
    return i * MAX + s;
}

vector<ll> dijkstra(int s) {

    vector<ll> dist(hen.size(), 1e15);
    priority_queue<P, vector<P>, greater<P>> que;
    que.emplace(0, s);
    dist[s] = 0;

    while(!que.empty()) {
        auto d = que.top().first;
        auto v = que.top().second;
        que.pop();
        if(dist[v] < d)continue;


        for(auto i : hen[v]) {
            int to = i.first;  //行き先の頂点
            int di = i.second; //時間

            if(dist[to] > dist[v] + di) {

                dist[to] = dist[v] + di;
                que.emplace(dist[to], to);

            }
        }

    }
    return dist;
}


int main()
{
    int n, m, s;
    cin >> n >> m >> s;
    s = min(s, MAX - 1);
    
    for(int i = 0; i < m; i++) {
        int u, v, a, b; cin >> u >> v >> a >> b; u--,v--;
        hens[u].push_back({v, i});
        hens[v].push_back({u, i});
        sil[i] = a; tim[i] = b;
    }

    for(int i = 0; i < n; i++) {
        int x, y; cin >> x >> y;
        c[i] = x; d[i] = y;
    }

    //頂点を増やす

    for(int i = 0; i < n; i++) {
        for(int j = 0; j < MAX; j++) {
            int nxt = j + c[i];
            nxt = min(nxt, MAX - 1);
            hen[value(i, j)].emplace_back(value(i, nxt), d[i]);

            for(auto k: hens[i]) {
                int nxt = j - sil[k.second];
                if(nxt < 0)continue;
                hen[value(i, j)].emplace_back(value(k.first, nxt), tim[k.second]);
            }
        }
    }

    auto dist = dijkstra(value(0, s));


    for(int i = 1; i < n; i++) {
    
        cout << *min_element(dist.begin() + value(i, 0), dist.begin() + value(i + 1, 0)) << endl;
        //for(int j = 0; j < MAX; j++) {}
    }

}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
using namespace std;
#define int long long
struct E{int to,co,ti;};
struct P{
  int tim,idx,res;
};
bool operator <(const P &a,const P &b){
  return a.tim<b.tim;
}
bool operator >(const P &a,const P &b){
  if(a.tim!=b.tim)return a.tim>b.tim;
  return a.res<b.res;
}
int ans[50][5001];
const long long LINF=1e18;
template<typename T>
void chmin(T &a,T b){
  if(a>b)a=b;
}

signed main(){
  memset(ans,-1,sizeof(ans));
  int n,m,s;cin>>n>>m>>s;chmin(s,5000LL);
  vector<E> edge[n];
  while(m--){
    int u,v,a,b;cin>>u>>v>>a>>b;u--;v--;
    edge[u].push_back({v,a,b});
    edge[v].push_back({u,a,b});
  }
  vector<int> c(n),d(n);
  for(int i=0;i<n;i++)cin>>c[i]>>d[i];
  priority_queue<P,vector<P>,greater<P>> que;
  que.push({0,0,s});
  vector<int> fans(n,-1);
  int cnt=0;
  while(que.size()){
    P p=que.top();que.pop();//cout<<p.idx<<" "<<p.res<<" "<<p.tim<<" "<<cnt<<endl;
    if(~ans[p.idx][p.res])continue;
    ans[p.idx][p.res]=p.tim;
    if(fans[p.idx]<0){
      fans[p.idx]=p.tim;
      if(++cnt==n)break;
    }
    do{
      for(auto q:edge[p.idx]){
        if(p.res<q.co||~ans[q.to][p.res-q.co])continue;
        que.push({p.tim+q.ti,q.to,p.res-q.co});
      }
      p.res+=c[p.idx];
      p.tim+=d[p.idx];
    }while(p.res<5000);
  }
  for(int i=1;i<n;i++)cout<<fans[i]<<endl;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { 
  INIT(){cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;

struct Edge {
  int to, cost, money;
  Edge(){}
  Edge(int to, int cost, int money) : to(to), cost(cost), money(money) {}
  bool operator < (const Edge &r) const {
    return cost < r.cost;
  }
};

signed main() {
  int N, M, S;
  cin >> N >> M >> S;

  int MAX = N*50;
  S = min(MAX, S);
  vector<vector<Edge>> graph(N);
  vector<int> u(M), v(M), a(M), b(M);
  REP(i, M){
    cin >> u[i] >> v[i] >> a[i] >> b[i];
    u[i]--; v[i]--;

    graph[u[i]].emplace_back(v[i], b[i], a[i]);
    graph[v[i]].emplace_back(u[i], b[i], a[i]);
  }

  vector<int> c(N), d(N);
  REP(i, N) cin >> c[i] >> d[i];

  vector<vector<int>> dist(N, vector<int>(MAX+5, INF));
  dist[0][S] = 0;

  queue<pair<int, int>> q;
  q.push({0, S});

  while(!q.empty()){
    auto p = q.front(); q.pop();
    int v = p.first;
    int m = p.second;

    if(m+c[v] <= MAX){
      if(dist[v][m+c[v]] > dist[v][m]+d[v]){
        dist[v][m+c[v]] = dist[v][m]+d[v];
        q.push({v, m+c[v]});
      }
    }
    for(auto u : graph[v]){
      if(m-u.money >= 0 && dist[u.to][m-u.money] > dist[v][m]+u.cost){
        dist[u.to][m-u.money] = dist[v][m]+u.cost;
        q.push({u.to, m-u.money});
      }
    }
  }

  FOR(i, 1, N){
    int ret = INF;
    REP(j, MAX){
      chmin(ret, dist[i][j]);
    }

    cout << ret << "\n";
  }

  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
using namespace std;
using ll=long long int;
using ld=long double;
using VI=vector<ll>;
using VD=vector<ld>;
using VVI=vector<VI>;
using VC=vector<char>;
using VVC=vector<VC>;
using VS=vector<string>;
using PLL =pair<ll,ll>;
using PLD=pair<ld,ld>;
using VPLL=vector<PLL>;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element((x).begin(),(x).end())
#define MIN(x) *min_element((x).begin(),(x).end())
#define SORTR(x) sort((x).rbegin(),(x).rend())
#define SORT(x) sort((x).begin(),(x).end())
#define SUM(x) accumulate((x).begin(),(x).end(), (ll)0)
#define FILL(x,a) fill(x.begin(),x.end(),a)
#define EACH(i,x) for(typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)

const int INF  = 1<<30;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template <class BidirectionalIterator>
bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle,BidirectionalIterator last){reverse(middle, last); return next_permutation(first , last);}
#define COUT(x) cout<<x<<"\n"

class Dijkstra{
 private:
  struct edge{
	ll to;
	ll cost;
  };
  vector<vector<edge>> G;
  vector<ll> d;
  ll siz;
 public:
  Dijkstra(ll n){
	  G.resize(n);
	  siz = n;
  }
  void add_edge(ll from,ll to,ll cost){
	  G[from].push_back(edge{to,cost});
  }
  vector<ll> dijkstra(ll s){
	  priority_queue<PLL,vector<PLL>,greater<PLL>> pq;
	  d.assign(siz,INF);
	  d[s] = 0;
	  pq.push(PLL(0,s));
	  while(!pq.empty()){
		  PLL p = pq.top();pq.pop();
		  ll v = p.second;
		  if (d[v] < p.first) continue;
		  for(edge &e:G[v]){
			  if (chmin(d[e.to],d[v]+e.cost)){
				  pq.push(PLL(d[e.to],e.to));
			  }
		  }
	  }
	  return d;
  }
};
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
void Main()
{
  ll n,m,s;
  cin >> n >> m >> s;
  Dijkstra g(2501*n); // u:2500*u+money
  ll u,v,a,b,c,d;
  REP(i,m){
    cin >> u >> v >> a >> b;
    --u;
    --v;
    rep(i,a,2501){
      g.add_edge(2501*u+i,2501*v+i-a,b);
      g.add_edge(2501*v+i,2501*u+i-a,b);
    }
  }
  rep(i,n){
    cin >> c >> d;
    rep(j,2500){
      g.add_edge(2501*i+j,2501*i+min(j+c,(ll)2500),d);
    }
  }
  vector<ll> dist = g.dijkstra(min(s,(ll)2500));
  rep(i,1,n){
    ll ans = INF;
    rep(j,2501){
      chmin(ans,dist[2501*i+j]);
    }
    COUT(ans);
  }

	return;
}

int main()
{
	std::cin.tie(0);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
 
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define INF 1e18

 
typedef long long ll;
ll mod = 998244353;

 long long fast_exp(long long a, long long b)
{
    if(b <= 0)
       return 1;
    else
    {
       long long res = 1;
       res = fast_exp(a,b/2);
       res = (res*res)%mod;
       if(b%2 == 1)
          res = (res*a)%mod;
       return res;
 
    }
}
typedef long double ld;
const long long N = 2e5+5;
struct ed{
    ll u,v,a,b;
};
vector <ed> edge[51];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll n, m, s, u, v, a, b;
    cin >> n >> m >> s;
    for(ll i = 0; i<m ; i++)
    {
        cin >> u >> v >> a >> b;
        ed e1;
        e1.u = u, e1.v = v, e1.a = a, e1.b = b;
        edge[u].pb(e1);
        e1.u = v;
        e1.v = u;
        edge[v].pb(e1);
    }
    ll c[n+1], d[n+1];
    for(ll i = 1; i<=n ; i++)
        cin >> c[i] >> d[i]; 
    ll dp[n+1][2501];
    ll vis[n+1][2501] = {};
    for(ll i = 0; i<=n ; i++)
        for(ll j = 0; j<2501 ; j++)
            dp[i][j] = INF;
    
    s = min(s,2500LL);
    dp[1][s] = 0;
    set< pair<ll,pair<ll,ll>> > q;
    q.insert({0,{1,s}});
    while(!q.empty())
    {
        pair<ll,pair<ll,ll>> cur = *q.begin();
        q.erase(cur);
        ll i = cur.ss.ff, j = cur.ss.ss;
        for(auto e: edge[i])
        {
            if(j >= e.a && dp[e.v][j-e.a] > dp[i][j] + e.b)
            {
                if(q.find({dp[e.v][j-e.a],{e.v,j-e.a}}) != q.end())
                    q.erase({dp[e.v][j-e.a],{e.v,j-e.a}});
                    dp[e.v][j-e.a] = dp[i][j] + e.b;
                    q.insert({dp[e.v][j-e.a],{e.v,j-e.a}});
            }
        }

        ll ni = i, nj = min(j + c[i],2500LL);
        if(dp[ni][nj] > dp[i][j] + d[i])
        {
            if(q.find({dp[ni][nj],{ni,nj}}) != q.end())
                q.erase({dp[ni][nj],{ni,nj}});
            dp[ni][nj] = dp[i][j] + d[i];
            q.insert({dp[ni][nj],{ni,nj}});
        }    
    }

    ll ans[n+1];
    for(ll i = 2; i<=n ; i++)
    {
        ans[i] = INF;
        for(ll j = 0; j<=2500; j++)
            ans[i] = min(ans[i],dp[i][j]);
    } 

    for(ll i = 2; i<=n ; i++)
        cout<< ans[i] << '\n';





  
    return 0;
 
 
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (in i = 0; i < (in)(n); i++)
#define REP(i,a,b) for(in i=(in)(a);i<(in)(b);i++)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const in inf=1e9+7;
using P=pair<in,in>;
vector<in> dx={0,1,-1,0};
vector<in> dy={1,0,0,-1};

using T=tuple<in,in,in,in>;

struct edge{in to; in cost;};
vector<vector<edge>> graph(0);
vector<in> d(0);
const in MAX_dist=INF;

void init(in n){
    graph.resize(n);
    d.resize(n,MAX_dist);
}

void dijkstra(in s){
    if(d.size()==0){cout<<"You Should init"<<endl;return;}
    priority_queue<P, vector<P>, greater<P>> que;
    d[s]=0;
    que.emplace(0,s);
    while(!que.empty()){
        P p=que.top();
        que.pop();
        in v=p.second;
        if(d[v]<p.first) continue;
        rep(i,graph[v].size()){
            edge e=graph[v][i];
            if(d[e.to]>d[v]+e.cost){
            d[e.to]=d[v]+e.cost;
            que.emplace(d[e.to],e.to);
            }
        }
    }
}

in main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    in n,m,s;
    cin>>n>>m>>s;
    vector<T> a(m);
    in x,y,z,w;
    rep(i,m){
        cin>>x>>y>>z>>w;
        x --,y --;
        a[i]=T(x,y,z,w);
    }
    vector<P> b(n);
    rep(i,n){
        cin>>x>>y;
        b[i]=P(x,y);
    }
    in ed=50ll*m+1;
    init(n*ed);
    rep(i,n){
        rep(j,ed-1){
            if(j+b[i].first<=ed){
                graph[i*ed+j].push_back({i*ed+j+b[i].first,b[i].second});
            }
            else{
                graph[i*ed+j].push_back({(i+1)*ed-1,b[i].second});
            }
        }
    }
    rep(i,m){
        tie(x,y,z,w)=a[i];
        rep(j,ed){
            if(j<z) continue;
            graph[x*ed+j].push_back({y*ed+j-z,w});
            graph[y*ed+j].push_back({x*ed+j-z,w});
        }
    }
    dijkstra(s);
    REP(i,1,n){
        in ans=INF;
        rep(j,ed){
            ans=min(ans,d[i*ed+j]);
        }
        cout<<ans<<'\n';
    }
}/*
./problem.exe
*/

Compiler output:
a.cc:52:1: error: '::main' must return 'int'
   52 | in main(){
      | ^~
Language: C

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef tuple<ll, ll, ll> tlll;
typedef pair<ll, ll> Pll;

ll N, M, S;
vector<vector<tlll>> graph;
vector<Pll> excha;

constexpr ll INF = 1e14;
constexpr ll MAXCOST = 2600;

int main() {
    cin >> N >> M >> S;
    graph.resize(N);
    for (int i = 0; i < M; i++) {
        ll U, V, A, B; cin >> U >> V >> A >> B;
        U--; V--;
        graph[U].push_back(tlll(V, A, B));
        graph[V].push_back(tlll(U, A, B));
    }
    excha.resize(N);
    for (int i = 0; i < N; i++) {
        cin >> excha[i].first >> excha[i].second;
    }

    vector<vector<ll>> ans(N, vector<ll>(MAXCOST+1, INF));
    // time, node, money;
    priority_queue<tlll, vector<tlll>, greater<tlll>> pq;
    pq.push(tlll(0, 0, min(S, MAXCOST)));

    while (!pq.empty()) {
        ll t, n, m; tie(t, n, m) = pq.top(); pq.pop();
        if (ans[n][m] != INF) continue;

        ans[n][m] = t;
        ll nxt = m + excha[n].first;
        ll tt = t + excha[n].second;
        if (nxt <= MAXCOST) {
            if (ans[n][nxt] > tt) pq.push(tlll(tt, n, nxt));
        }
        for (auto x : graph[n]) {
            ll u, a, b; tie(u, a, b) = x;
            if (m >= a) {
                if (ans[u][m-a] > t+b) pq.push(tlll(t+b, u, m-a));
            }
        }
    }
    for (int i = 1; i < N; i++) {
        ll a = INF;
        for (int j = 0; j <= MAXCOST; j++) {
            a = min(a, ans[i][j]);
        }
        cout << a << endl;
    }
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
using namespace std;
#define int long long
struct E{int to,co,ti;};
struct P{
  int tim,idx,res;
};
bool operator <(const P &a,const P &b){
  return a.tim<b.tim;
}
bool operator >(const P &a,const P &b){
  if(a.tim!=b.tim)return a.tim>b.tim;
  return a.res<b.res;
}

signed main(){
  int n,m,s;cin>>n>>m>>s;
  vector<E> edge[n];
  while(m--){
    int u,v,a,b;cin>>u>>v>>a>>b;u--;v--;
    edge[u].push_back({v,a,b});
    edge[v].push_back({u,a,b});
  }
  vector<int> c(n),d(n);
  for(int i=0;i<n;i++)cin>>c[i]>>d[i];
  priority_queue<P,vector<P>,greater<P>> que;
  vector<int> ans(n,-1);
  que.push({0,0,s});
  int cnt=0;
  while(que.size()){
    P p=que.top();que.pop();bool al=true;
    if(ans[p.idx]<0){
      al=false;
      ans[p.idx]=p.tim;
      if(++cnt==n)break;
    }
    do{
      for(auto q:edge[p.idx]){
        if(q.co>p.res)continue;
        que.push({p.tim+q.ti,q.to,p.res-q.co});
      }
      p.res+=c[p.idx];
      p.tim+=d[p.idx];
    }while(!al&&p.res<=5000);
  }
  for(int i=1;i<n;i++)cout<<ans[i]<<endl;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.