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

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

using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  // 重み付き無向(有向)グラフの隣接リスト
  int n, m; // n:頂点数 m:辺数
  ll s;
  cin >> n >> m >> s;
  
  vector<vector<pair<int, pair<ll, ll>>>> G(n); // G:頂点数nのグラフの隣接リスト
  
  for (int i = 0; i < m; i++) {
    int u, v;
    ll 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);
  for (int i = 0; i < n; i++) cin >> c.at(i) >> d.at(i);
  
  s = min<ll>(s, 2500);
  vector<vector<ll>> dp(n, vector<ll>(2501, 1e18));
  dp.at(0).at(s) = 0;
  
  priority_queue<tuple<ll, ll, int>, vector<tuple<ll, ll, int>>, greater<tuple<ll, ll, int>>> pq;
  pq.push(make_tuple(0, s, 0));
  while (!pq.empty()) {
    auto [time, silver, node] = pq.top();
    pq.pop();
    if (dp.at(node).at(silver) < time) continue;
    dp.at(node).at(silver) = time;
    if (silver < 2500) {
      ll keep = min<ll>(silver + c.at(node), 2500);
      if (dp.at(node).at(keep) > time + d.at(node)) {
        dp.at(node).at(keep) = time + d.at(node);
        pq.push(make_tuple(time + d.at(node), keep, node));
      }
    }
    for (int i = 0; i < G[node].size(); i++) {
      if (silver < G[node].at(i).second.first) continue;
      if (dp.at(G[node].at(i).first).at(silver - G[node].at(i).second.first) <= time + G[node].at(i).second.second) continue;
      dp.at(G[node].at(i).first).at(silver - G[node].at(i).second.first) = time + G[node].at(i).second.second;
      pq.push(make_tuple(time + G[node].at(i).second.second, silver - G[node].at(i).second.first, G[node].at(i).first));
    }
  }
  
  for (int i = 1; i < n; i++) {
    ll keep = 1e18;
    for (int j = 0; j <= 2500; j++) {
      keep = min(keep, dp.at(i).at(j));
    }
    cout << keep << '\n';
  }
}

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>

const int max_n = 50;
const int max_s = (max_n - 1) * 50;

struct train
{
    int v, a, b;
    train(int v, int a, int b) : v(v), a(a), b(b) {}
};

struct change
{
    int c, d;
};

struct data
{
    int i, s;
    long long t;
    data(int i, int s, long long t) : i(i), s(s), t(t) {}

    bool operator<(const data &d) const
    {
        return t > d.t;
    }
};

int main()
{
    int n, m, s;
    std::cin >> n >> m >> s;
    std::vector<train> t[max_n];
    for (int i = 0; i < m; ++i)
    {
        int u, v, a, b;
        std::cin >> u >> v >> a >> b;
        --u;
        --v;
        t[u].emplace_back(v, a, b);
        t[v].emplace_back(u, a, b);
    }

    change c[max_n];
    for (int i = 0; i < n; ++i)
    {
        std::cin >> c[i].c >> c[i].d;
    }

    long long time[max_n][max_s + 1];
    for (int i = 0; i < max_n; ++i)
    {
        std::fill(time[i], time[i] + max_s + 1, LONG_LONG_MAX);
    }

    std::priority_queue<data> q;
    auto push = [&](int i, int s, long long t) {
        int mins = std::min(s, max_s);
        if (mins < 0)
        {
            return;
        }
        if (time[i][mins] <= t)
        {
            return;
        }
        time[i][mins] = t;
        q.emplace(i, mins, t);
    };
    push(0, s, 0);

    while (!q.empty())
    {
        data d = q.top();
        q.pop();
        if (d.t > time[d.i][d.s])
        {
            continue;
        }

        for (int j = 0; j < t[d.i].size(); ++j)
        {
            push(t[d.i][j].v, d.s - t[d.i][j].a, d.t + t[d.i][j].b);
        }
        push(d.i, d.s + c[d.i].c, d.t + c[d.i].d);
    }

    for (int i = 1; i < n; ++i)
    {
        long long min = LONG_LONG_MAX;
        for (int j = 0; j <= max_s; ++j)
        {
            min = std::min(time[i][j], min);
        }
        std::cout << min << std::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

def Int():
    return int(input())
def Ints():
    return map(int,input().split())
def IntList():
    return list(Ints())
def IntMat(N):
    return [IntList() for i in range(N)]

N,M,S = Ints()
from collections import defaultdict
Graph  = defaultdict(list)

for i in range(M):
    u,v,a,b = Ints()
    Graph[u-1].append([v-1,a,b])
    Graph[v-1].append([u-1,a,b])

City = [0]*N
for i in range(N):
    c,d = Ints()
    City[i] = [c,d]

import heapq
que = []
# [time, nowhere, money, flag, visited]
heapq.heappush(que, [0, 0, min(S,5000)])
ans = [[10**16]*5001 for i in range(N)]
#Min = [[10**16]*5001 for i in range(N+1)]
#print(Graph)
while que != []:
    time, nowhere, money = heapq.heappop(que)
    #print('here',time,nowhere,money)
    if time <= ans[nowhere][money]:
        ans[nowhere][money] = time
        c,d = City[nowhere]
        if time+d < ans[nowhere][min(5000,money+c)]:
            ans[nowhere][min(5000,money+c)] = time+d
            #print('to',time+d, nowhere, min(5000,money+c))
            heapq.heappush(que, [time+d, nowhere, min(5000,money+c)])
        for (to,a,b) in Graph[nowhere]:
            if 0 <= money - a and time+b < ans[to][min(5000,money-a)]:
                ans[to][min(5000,money-a)] = time+b
                #print('to',time+b, to, min(5000,money-a))
                heapq.heappush(que, [time+b, to, min(5000,money-a)])

for i in range(1,N):
    print(min(ans[i]))

Compiler output:
main.c:1:1: error: unknown type name 'def'
    1 | def Int():
      | ^~~
main.c: In function 'Int':
main.c:1:10: error: expected declaration specifiers before ':' token
    1 | def Int():
      |          ^
main.c:26:3: error: invalid preprocessing directive #[
   26 | # [time, nowhere, money, flag, visited]
      |   ^
main.c:29:2: error: invalid preprocessing directive #Min
   29 | #Min = [[10**16]*5001 for i in range(N+1)]
      |  ^~~
main.c:30:2: error: invalid preprocessing directive #print
   30 | #print(Graph)
      |  ^~~~~
main.c:33:6: error: invalid preprocessing directive #print
   33 |     #print('here',time,nowhere,money)
      |      ^~~~~
main.c:39:14: error: invalid preprocessing directive #print
   39 |             #print('to',time+d, nowhere, min(5000,money+c))
      |              ^~~~~
main.c:44:18: error: invalid preprocessing directive #print
   44 |                 #print('to',time+b, to, min(5000,money-a))
      |                  ^~~~~
Language: C

#include <bits/stdc++.h>
#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, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007;
//const ll mod = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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 (a>b) { a=b; return 1; } return 0; }

struct Edge {
  ll t, c, m;

  bool operator < (const Edge& e) const {
    return m > e.m;
  }
};

vector<Edge> G[55];

vector<vector<ll>> dp(55, vector<ll>(2505, INF));

void dijkstra(ll s) {
  repr(i, s) dp[0][s] = 0;
  priority_queue<pair<Edge, ll>> pq;
  pq.push({{0, 0, 0}, s});
  while (!pq.empty()) {
    ll v = pq.top().first.t, resc = pq.top().second;
    pq.pop();
    for (Edge e: G[v]) {
      ll nxtc = resc - e.c;
      if (nxtc < 0) continue;
      chmin(nxtc, 2500LL);
      if (chmin(dp[e.t][nxtc], dp[v][resc] + e.m)) {
        pq.push({e, nxtc});
        repr(i, nxtc - 1) {
          if (!chmin(dp[e.t][i], dp[v][resc] + e.m)) break;
        }
      }
    }
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(25);

  ll n, m, s;
  cin >> n >> m >> s;
  chmin(s, 2500LL);
  rep(i, m) {
    ll u, v, a, b;
    cin >> u >> v >> a >> b;
    u--, v--;
    G[u].push_back({v, a, b});
    G[v].push_back({u, a, b});
  }
  rep(i, n) {
    ll c, d;
    cin >> c >> d;
    G[i].push_back({i, -c, d});
  }
  dijkstra(s);
  FOR(i, 1, n) cout << dp[i][0] << '\n';







  
  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

//ABC164-E
//拡張ダイクストラ

#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<int, P> Pp;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}

const int INF = 1e18;

//銀貨はこれ以上持たなくてよい（最大制約下でも余る）
const int MAX = 2500;

//辺の構造体（次の頂点、運賃、移動時間）
typedef struct Edge{
    int u, c, t;
} Edge;

V(V(Edge)) G(55);
vi C(55), D(55);

//各頂点について、所持している銀貨の枚数ごとの移動時間を記録する
vvi dist(55, vi(MAX, INF));

void dijkstra(int S) {
    S = min(S, MAX);
    dist[0][S] = 0;
    priority_queue<Pp, V(Pp), greater<Pp>> q;
    q.push(Pp(0, P(0, S)));

    while(!q.empty()) {
        Pp p = q.top(); q.pop();
        int v = p.se.fi, d = p.fi, s = p.se.se;
        if(d > dist[v][s]) continue;

        //銀貨の補充は、自分自身への移動と考える
        if(s+C[v] <= MAX) {
            if(d+D[v] < dist[v][s+C[v]]) {
                dist[v][s+C[v]] = d+D[v];
                q.push(Pp(d+D[v], P(v, s+C[v])));
            }
        }

        //通常のダイクストラ
        rep(i, G[v].size()) {
            int nv = G[v][i].u;
            int nd = d + G[v][i].t;
            int ns = s - G[v][i].c;
            if(ns<0) continue;
            if(nd < dist[nv][ns]) {
                dist[nv][ns] = nd;
                q.push(Pp(nd, P(nv, ns)));
            }
        }
    }
}



signed main() {
    int N, M, S;
    cin >> N >> M >> S;
    rep(i, M) {
        int u, v, a, b;
        cin >> u >> v >> a >> b;
        u--; v--;
        G[u].pb(Edge{v, a, b});
        G[v].pb(Edge{u, a, b});
    }
    rep(i, N) cin >> C[i] >> D[i];

    dijkstra(S);

    FOR(i, 1, N) {
        int res = INF;
        rep(j, MAX) {
            res = min(res, dist[i][j]);
        }
        cout << res << endl;
    }

    return 0;
}

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

//#pragma GCC optimize ("O3")
//#pragma GCC target ("avx")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

constexpr int bm = 2500;
ll BIT[51][bm];
void add(int A, int gin, ll co) {
	co = 4e12 - co;
	while (gin > 0) {
		BIT[A][gin] = max(BIT[A][gin], co);
		gin -= gin & -gin;
	}
}
ll query(int A, int gin) {
	ll kotae = 0;
	while (gin < bm) {
		kotae = max(BIT[A][gin], kotae);
		gin += gin & -gin;
	}
	return 4e12 - kotae;
}

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


	int N, M, S;
	cin >> N >> M >> S;
	if (S >= 2460) S = 2460;

	vector<ll> E[51];
	rep(i, M) {
		int u, v, a;
		ll b;
		cin >> u >> v >> a >> b;
		b = a << 8 | b << 16;
		E[u].pb(v | b);
		E[v].pb(u | b);
	}
	int C[51], D[51];
	rep1(i, N) {
		cin >> C[i] >> D[i];
	}

	add(1, S + 1, 0);
	priority_queue<ll, vector<ll>, greater<ll> > PQ;
	PQ.push((1 << 12) + S + 1);

	while (PQ.size()) {
		auto p = PQ.top();
		PQ.pop();
		ll ti = p >> 18;
		int i = p >> 12 & 63;
		int gin = p & 4095;



		if (ti > query(i, gin)) continue;

		ll ti2 = ti + D[i];
		int gin2 = gin + C[i];
		if (gin2 > 2460) gin2 = 2460;
		if (ti2 < query(i, gin2)) {
			add(i, gin2, ti2);
			PQ.push(ti2 << 18 | i << 12 | gin2);
		}

		for (auto pp : E[i]) {
			int to = pp & 255;
			ti2 = ti + (pp >> 16);
			gin2 = gin - (pp >> 8 & 255);
			if (gin2 > 0) {
				if (ti2 < query(to, gin2)) {
					add(to, gin2, ti2);
					PQ.push(ti2 << 18 | to << 12 | gin2);
				}
			}
		}

	}

	for (int i = 2; i <= N; i++) {
		co(query(i, 1));
	}



	Would you please return 0;
}

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

#include<queue>
#include<math.h>
#include<cmath>
#include<bitset>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iostream>
#include<utility>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> P;
struct edge{
    ll to;
    ll cost;
    ll en;
    edge(ll t, ll w,ll e) : to(t), cost(w) ,en(e){ }
};
int main(){
  vector<vector<edge> > g(60);
  long long i,j,n,m,s,u,V,a,b,c[60],d[60];
  long long ds[60][3010],ns[60][3010];
  const long long INF=1000000000000000;
  priority_queue<P,vector<P>,greater<P> > que;
  scanf("%lld %lld %lld\n",&n,&m,&s);
  for(i=0;i<m;i++){
    scanf("%lld %lld %lld %lld\n",&u,&V,&a,&b);
    u--,V--;
    g[u].push_back(edge(V,b,a));
    g[V].push_back(edge(u,b,a));
  }
  for(i=0;i<n;i++){
    scanf("%lld %lld\n",&c[i],&d[i]);
  }
  for(i=0;i<n;i++){
    for(j=0;j<3000;j++){
      ds[i][j]=INF,ns[i][j]=0;
    }
  }
  if(s>2800){
    s=2800;
  }
  ds[0][s]=0,ns[0][s]=1;
  que.push(make_pair(0,pll(0,s)));
  while(!que.empty()){
    P p=que.top();
    ll v=p.second.first,w=p.second.second;
    que.pop();
    for(i=0;i<g[v].size();i++){
      edge us=g[v][i];
      if(ds[us.to][w-us.en]>ds[v][w]+us.cost && ns[us.to][w-us.en]==0 && w-us.en>=0){
        ds[us.to][w-us.en]=ds[v][w]+us.cost;
        que.push(make_pair(ds[us.to][w-us.en],pll(us.to,w-us.en)));
      }
      if(ds[v][w+c[v]]>ds[v][w]+d[v] && ns[v][w+c[v]]==0){
        ds[v][w+c[v]]=ds[v][w]+d[v];
        que.push(make_pair(ds[v][w+c[v]],pll(v,w+c[v])));
      }
    }
    ns[v][w]=1;
  }
  for(i=1;i<n;i++){
    ll min=INF;
    for(j=0;j<3000;j++){
      if(min>ds[i][j]){
        min=ds[i][j];
      }
    }
    printf("%lld\n",min);
  }
  return 0;
}

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

#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> pl3;

const ll max_n = 52;
const ll max_s = 2500;
vector<ll> c, d;
vector<pl3> g[max_n];

ll n, m;
ll s;

const ll INF = 1e15;
ll dp[max_n+1][max_s + 1];
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin >> n >> m >> s;
	rep(i, m){
		ll u, v, a, b;
		cin >> u >> v >> a >> b;
		u--;
		v--;
		g[u].push_back({v, {a, b}});
		g[v].push_back({u, {a, b}});
	}

	c.resize(n);
	d.resize(n);
	rep(i, n) cin >> c[i] >> d[i];

	dijkstra();

	rep(i, n-1){
		ll ans = INF;
		rep(j, max_s + 1) ans = min(ans, dp[i+1][j]);
		cout << ans << "\n";
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:9: error: 'dijkstra' was not declared in this scope
   38 |         dijkstra();
      |         ^~~~~~~~
Language: C

#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl
#define show2(a, n, m) rep(i, n) { rep(j, m) {cout << a[i][j] << ' ';} cout << endl;} 
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<long long, long long> pll;
typedef long double ld;

const int INF = 1 << 30;
const long long INFL = 1LL << 60;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100010;

typedef tuple<ll, ll, ll> tup3;
vector<vector<tup3>> g;	// node, cost, time
vector<vll> d;	// time, coin
ll cmax;

void dijkstra(ll s) {
	priority_queue<tup3, vector<tup3>, greater<tup3>> q;	// time, node, coin
	q.push(make_tuple(0, 0, min(s, cmax)));
	d[0][min(s, cmax)] = 0;
	while(!q.empty()) {
		ll cur_time, cur_node, coin;
		tie(cur_time, cur_node, coin) = q.top();
		q.pop();
		for(auto i: g[cur_node]) {
			ll nxt_node, cost, taken_time;
			tie(nxt_node, cost, taken_time) = i;
			if(coin < cost) continue;
			ll nxt_coin = min(coin - cost, cmax);
			if(d[nxt_node][nxt_coin] <= cur_time + taken_time) continue;
			q.push(make_tuple(cur_time + taken_time, nxt_node, nxt_coin));
			d[nxt_node][nxt_coin] = cur_time + taken_time;
		}
	}
}

int main() {
//	cout << fixed << setprecision(15);
	ll n, m, s;
	cin >> n >> m >> s;

	g = vector<vector<tup3>>(n);
	ll amax = 0;
	rep(i, m) {
		ll u, v, a, b;
		cin >> u >> v >> a >> b;
		u--, v--;
		g[u].push_back(make_tuple(v, a, b));
		g[v].push_back(make_tuple(u, a, b));
		chmax(amax, a);
	}
	rep(i, n) {
		ll c, d;
		cin >> c >> d;
		g[i].push_back(make_tuple(i, -c, d));
	}

	cmax = amax * n + 1;
	d = vector<vll>(n, vll(cmax, INFL));
	dijkstra(s);
	rep1(i, n - 1) {
		ll ans = INFL;
		rep(j, cmax) chmin(ans, d[i][j]);
		cout << ans << endl;
	}
}


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;
typedef long long ll;
const ll INF=1e16;
const int MAX=2500;
const int N=105;
ll n,m,s;
ll a[N][N],b[N][N],c[N],d[N],f[N][MAX+10],v[N][MAX+10];
struct node {
	ll num1,num2,len;
	node() {}
	node(ll a,ll b,ll c) {
		num1=a; num2=b; len=c;
	}
	bool operator<(const node &node1) const {
		return len<node1.len;
	}
	bool operator>(const node &node1) const {
		return len>node1.len;
	}
};
priority_queue<node,vector<node>,greater<node>> q;
inline calc(ll x) {
	if (x>MAX) return MAX;
	else return x;
}
int main() {
	ll u,w,x,y,i,j,ans;
	node p;
	scanf("%lld%lld%lld",&n,&m,&s);
	for (i=1;i<=n;i++)
		for (j=1;j<=n;j++)
			b[i][j]=INF;
	for (i=1;i<=m;i++) {
		scanf("%lld%lld%lld%lld",&u,&w,&x,&y);
		a[u][w]=a[w][u]=x;
		b[u][w]=b[w][u]=y;
	}
	for (i=1;i<=n;i++)
		scanf("%lld%lld",&c[i],&d[i]);
	s=calc(MAX);
	q.push(node(1,s,0));
	for (i=1;i<=n;i++)
		for (j=0;j<=MAX;j++)
			f[i][j]=INF;
	f[1][s]=0;
	while (!q.empty()) {
		p=q.top(); q.pop();
		x=p.num1; y=p.num2;
		if (v[x][y]>0) continue;
		v[x][y]=1;
		if (!v[x][calc(y+c[x])]&&f[x][y]+d[x]<f[x][calc(y+c[x])]) {
			f[x][calc(y+c[x])]=f[x][y]+d[x];
			q.push(node(x,calc(y+c[x]),f[x][y]+d[x]));
		}
		for (i=1;i<=n;i++)
			if (b[x][i]<INF) {
				if (y-a[x][i]>=0&&!v[i][y-a[x][i]]&&f[x][y]+b[x][i]<f[i][y-a[x][i]]) {
					f[i][y-a[x][i]]=f[x][y]+b[x][i];
					q.push(node(i,y-a[x][i],f[x][y]+b[x][i]));
				}
			}
	}
	for (i=2;i<=n;i++) {
		ans=INF;
		for (j=0;j<=MAX;j++)
			ans=min(ans,f[i][j]);
		printf("%lld\n",ans);
	}
	return 0;
} 

Compiler output:
a.cc:23:8: error: ISO C++ forbids declaration of 'calc' with no type [-fpermissive]
   23 | inline calc(ll x) {
      |        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF=1e16;
const int MAX=2500;
const int N=105;
ll n,m,s;
ll a[N][N],b[N][N],c[N],d[N],f[N][MAX+10],v[N][MAX+10];
struct node {
	ll num1,num2,len;
	node() {}
	node(ll a,ll b,ll c) {
		num1=a; num2=b; len=c;
	}
	bool operator<(const node &node1) const {
		return len<node1.len;
	}
	bool operator>(const node &node1) const {
		return len>node1.len;
	}
};
priority_queue<node,vector<node>,greater<node>> q;
inline calc(ll x) {
	if (x>MAX) return MAX;
	else return x;
}
int main() {
	ll u,w,x,y,i,j,ans;
	node p;
	scanf("%lld%lld%lld",&n,&m,&s);
	for (i=1;i<=n;i++)
		for (j=1;j<=n;j++)
			b[i][j]=INF;
	for (i=1;i<=m;i++) {
		scanf("%lld%lld%lld%lld",&u,&w,&x,&y);
		a[u][w]=a[w][u]=x;
		b[u][w]=b[w][u]=y;
	}
	for (i=1;i<=n;i++)
		scanf("%lld%lld",&c[i],&d[i]);
	q.push(node(1,s,0));
	for (i=1;i<=n;i++)
		for (j=0;j<=MAX;j++)
			f[i][j]=INF;
	f[1][s]=0;
	while (!q.empty()) {
		p=q.top(); q.pop();
		x=p.num1; y=p.num2;
		if (v[x][y]>0) continue;
		v[x][y]=1;
		if (!v[x][calc(y+c[x])]&&f[x][y]+d[x]<f[x][calc(y+c[x])]) {
			f[x][calc(y+c[x])]=f[x][y]+d[x];
			q.push(node(x,calc(y+c[x]),f[x][y]+d[x]));
		}
		for (i=1;i<=n;i++)
			if (b[x][i]<INF) {
				if (y-a[x][i]>=0&&!v[i][y-a[x][i]]&&f[x][y]+b[x][i]<f[i][y-a[x][i]]) {
					f[i][y-a[x][i]]=f[x][y]+b[x][i];
					q.push(node(i,y-a[x][i],f[x][y]+b[x][i]));
				}
			}
	}
	for (i=2;i<=n;i++) {
		ans=INF;
		for (j=0;j<=MAX;j++)
			ans=min(ans,f[i][j]);
		printf("%lld\n",ans);
	}
	return 0;
} 

Compiler output:
a.cc:23:8: error: ISO C++ forbids declaration of 'calc' with no type [-fpermissive]
   23 | inline calc(ll x) {
      |        ^~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
# define mod 1000000007
/* ちゃんと考えてわかって実装 */

const int MAX_V = 50;
const int MAX_S = 50 * MAX_V + 5;
const ll INF = 1e18;

// struct Edge{
//     int to, a, b;

//     // これを書いたらerrorが取れた。どうして必要なのｫぉ
//     Edge(int to, int a, int b):to(to),a(a),b(b) {}
// };

typedef struct Edge{
    int to, a, b;
};

struct State{
    int v, s; // state = (頂点, 所持金)
    ll x; // その状態までの経過時間

    // これを書いたらerrorが取れた。どうして必要なのｫぉ
    State(int v, int s, ll x):v(v),s(s),x(x) {}

    bool operator<(const State& a) const {
        return x > a.x; // (x < a.x だとちゃんと動かねぇ)
    }
};

vector<Edge> g[MAX_V]; // 各頂点から伸びている辺の集合として保持。
ll min_time[MAX_V][MAX_S+5]; // 状態(v, s)までの最小の時間を記録。


int main(void){
    int n, m, s;
    cin >> n >> m >> s;

    for(int i=0; i<m; i++){
        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);
    }

    for(int i=0; i<n; i++){
        for(int j=0; j<MAX_S+5; j++){
            min_time[i][j] = INF;
        }
    }

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

    s = min(s, MAX_S); // 十分な値で切り捨てる。
    priority_queue<State> pq;

    // pqに状態(v, s, x)を emplace するときに、
    // min_time[v][s]の値を x に更新する。(xが最小じゃないなら更新しない。)
    auto push = [&](int v, int s, ll x){
        if(s < 0) return;
        if(min_time[v][s] <= x) return;
        min_time[v][s] = x;
        pq.emplace(v, s, x);
    };

    // 初期状態は(0, s, 0)
    push(0, s, 0);
    while(!pq.empty()){
        State now = pq.top(); pq.pop();
        int v = now.v, s = now.s;
        ll x = now.x;

        // if(min_time[v][s] != x) continue; // なぜ?????(消しても通る)
        
        // 遷移その1 : 換金
        int next_s = min(s+c[v], MAX_S);
        push(v, next_s, x+d[v]);
        

        // 遷移その2 : 電車に乗る
        // そこから伸びている辺を全てみる
        for(Edge e : g[v]){
            push(e.to, s-e.a, x+e.b);
        }
    }

    // 答えの出力(min_timeのなかにある)
    for(int i=1; i<n; i++){
        ll ans = INF;
        for(int j=0; j<MAX_S+5; j++){
            ans = min(ans, min_time[i][j]);
        }
        cout << ans << 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

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define INF (1LL<<50)

struct edge{int from,to; int silver; int wait;};
struct vertex{int silver, wait;};

int N, M, S;
vertex V[50];
vector<edge> E[50];

int dp[50][5100*2];

signed main() {
  cin >> N >> M >> S;
  S = min(5000LL, S);
  for(int i=0; i<M; i++) {
    int u,v,a,b;
    cin >> u >> v >> a >> b;
    u--, v--;
    edge uv, vu;
    uv.from = u;
    uv.to = v;
    uv.silver = a;
    uv.wait = b;
    vu.from = v;
    vu.to = u;
    vu.silver = a;
    vu.wait = b;
    E[u].push_back(uv);
    E[v].push_back(vu);
  }
  for(int i=0; i<N; i++) { 
    cin >> V[i].silver >> V[i].wait;
    V[i].silver = min(5000LL, V[i].silver);
  }

  for(int i=0; i<N; i++) for(int j=0; j<=5099; j++) { dp[i][j] = INF; }

  dp[0][S] = 0;
  for(int s=S+V[0].silver, wait=V[0].wait; s<=5000; s+=V[0].silver) {
    dp[0][s] = wait;
    wait += V[0].wait;
    //cerr << s << "\t" << dp[0][s] << endl;
  }

  queue<int> q;
  q.push(0);
  while(q.size()) {
    int v = q.front(); q.pop();

    for(int s=0; s<=5000; s++) {
      for(int s2=s+V[v].silver, w=V[v].wait; s2<=5000; s2+=V[v].silver) {
        dp[v][s2] = min(dp[v][s2], dp[v][s] + w);
        w += V[v].wait;
      }
    }

    for(auto e : E[v]) {
      bool mada = true;
      for(int s=0; s+e.silver<=5000; s++) {
        if(dp[e.to][s] > dp[e.from][s + e.silver] + e.wait) {
          dp[e.to][s] = min(dp[e.to][s], dp[e.from][s + e.silver] + e.wait);
          if(mada) {
            q.push(e.to);
            mada=false;
          }
        }
      }
    }
  }

  for(int v=1; v<N; v++) {
    int ans = INF;
    for(int s=0; s<=5000; s++) {
      ans = min(ans, dp[v][s]);
    }
    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;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  long long n,m,s;
  long long t=5000;
  cin >> n >> m >> s;
  vector<vector<long long>> k(n,vector<long long>(t));
  long long inf=100000000000000;
  rep(i,n){
    rep(j,t){
      k[i][j]=inf;
    }
  }
  vector<long long> u(n);
  vector<long long> v(n);
  vector<vector<long long>> uu(n,vector<long long>(n));
  vector<vector<long long>> vv(n,vector<long long>(n));
  rep(i,n){
    rep(z,n){
      uu[i][z]=0;
      vv[i][z]=0;
    }
  }
  vector<vector<long long>> w(n,vector<long long>(1,inf));
  //rep(i,n)w[i].pop_back();
  rep(i,m){
    long long a,b,c,d;
    cin >> a >> b >> c >> d;
    a--;
    b--;
    w[a].push_back(b);
    w[b].push_back(a);
    uu[a][b]=c;
    uu[b][a]=c;
    vv[a][b]=d;
    vv[b][a]=d;
  }
  rep(i,n){
    cin >> u[i];
    cin >> v[i];
  }
  vector<long long> o(n,0);
  rep(i,min(t,s+1)){
    k[0][i]=0;
  }
  while(true){
    long long b=-1;
    long long mi=inf/1000;
    rep(i,n){ 
      if(o.at(i)<t&&k.at(i).at(o.at(i))<mi){
        mi=k.at(i).at(o.at(i));
        b=i;
      }
    }
    if(b==-1)break;
    o.at(b)++;
    //if(o[b]%3==0||o[b]<10)cout << b << " " << o[b] << endl;
    for(long long h: w.at(b)){
      if(h>1000)continue;
      if(o.at(h)==t)continue;
      if(o.at(h)+uu.at(b).at(h)>=t)continue;
      if(o[b]-1-uu[b][h]>=0){
        k[h][o[b]-1-uu[b][h]]=min(k[h][o[b]-1-uu[b][h]],k[b][o[b]-1]+vv[b][h]);
        //cout << h << b  <<  " " << k[h][o[b]-1-uu[b][h]] << endl;
      }
      //else if(o[b]<20)cout << o[b] << " " << uu[b][h] << endl;
      //if(h==2&&b!=0)cout << h << " " << b << " " << k[h][o[h]] << " " << k[b][o[h]+uu[b][h]] << " " << vv[b][h] << endl;
    }
    long long y=0;
    long long p=max(y,o[b]-u[b]);
    if(o[b]>=t)continue;
    k[b][o[b]]=min(k[b][o[b]],k[b][p]+v[b]);
  }
  rep(i,n-1){
    cout << k[i+1][0] << 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 <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <numeric>
#include <queue>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<n;++i)
#define mrep(i,n) for(ll i=n;i>=0;--i)
#define all(a) (a).begin(),(a).end()
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vb vector<bool>
#define vvb vector<vector<bool> >
#define pl pair<ll,ll>
#define inf 1001001001001001000
#define mod 1000000007
#define pi 3.1415926535
using namespace std;

template<typename T>
struct Graph{
    vector<T> nodes;
    map<T,vector<pair<T,ll> > > nexts;
    Graph(ll n,T initial){
        nodes.resize(n,initial);
    }
    Graph(ll n){
        nodes.resize(n);
    }
    Graph(vector<T> &a):nodes(a){}
    Graph(){}
    void add_edge(T &s,T &e,ll c){
        this->nexts[s].push_back({e,c});
    }
    map<T,ll> dijkstra(T &s){
        map<T,ll> dist;
        for(T tmp:this->nodes){
            dist[tmp] = inf;
        }
        priority_queue<pair<ll,T>,vector<pair<ll,T> >,greater<pair<ll,T> > > q;
        q.push({0,s});
        dist[s] = 0;
        while(q.empty() == false){
            pair<ll,T> now = q.top();
            q.pop();
            if(now.first > dist[now.second]) continue;
            dist[now.second] = now.first;
            for(pair<T,ll> next:this->nexts[now.second]){
                if(now.first + next.second < dist[next.first]){
                    dist[next.first] = now.first+next.second;
                    q.push({dist[next.first],next.first});
                }
            }
        }
        return dist;
    }
};

struct Node{
    ll x;
    Node(ll a): x(a){}
    Node(): x(1){}
    bool operator<(const Node &b)const{
        return this->x < b.x;
    }
};

int main(void){
    ll n,m,s;
    cin>>n>>m>>s;
    s = min(s,2600LL);
    Graph<pl> g;
    rep(i,n){
        rep(j,2601){
            g.nodes.push_back(pl()={i+1,j});
        }
    }
    rep(i,m){
        ll u,v,a,b;
        cin>>u>>v>>a>>b;
        rep(j,2601){
            if(j>=a){
                g.add_edge(pl()={u,j},pl()={v,j-a},b);
                g.add_edge(pl()={v,j},pl()={u,j-a},b);
            }
        }
    }
    rep(i,n){
        ll c,d;
        cin>>c>>d;
        rep(j,2601){
            if(j+c <= 2600){
                g.add_edge(pl()={i+1,j},pl()={i+1,j+c},d);
            }
        }
    }
    map<pl,ll> dist = g.dijkstra(pl()={1,s});
    vl ans(n+1,inf);
    rep(i,n){
        rep(j,2601){
            ans[i+1] = min(ans[i+1],dist[{i+1,j}]);
        }
    }
    rep1(i,n){
        cout<<ans[i+1]<<endl;
    }
}

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

#include <iostream>
#include<map>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<ctime>
using namespace std;
#define ll long long
#define IO std::ios::sync_with_stdio(false);std::cin.tie(0)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
#define mset(s,_) memset(s,_,sizeof s)
#define fi first
#define se second
#define pb push_back

const int maxn = 101;

struct node {
	ll pos, ns, nt;
	bool operator<(const node &T)const{
		return nt > T.nt;
	}
};

struct Edge {
	ll to, nxt, w, t;
}edge[maxn << 1];

ll n, m, s, head[maxn], mm, c[maxn], d[maxn];
ll dp[100][2600];

void add(int x, int y, int w, int t) {
	edge[++mm] = { y,head[x],w,t };
	head[x] = mm;
}

int main() {
	cin >> n >> m >> s;
	rep(i, 1, m) {
		int x, y, w, t;
		cin >> x >> y >> w >> t;
		add(x, y, w, t);
		add(y, x, w, t);
	}
	rep(i, 1, n) cin >> c[i] >> d[i];
	if (s > 2500) s = 2500;
	mset(dp, 0x7f);
	dp[1][s] = 0;
	priority_queue<node>q;
	q.push({ 1,s,0 });
	while (!q.empty()) {
		node now = q.top();
		q.pop();
		ll x = now.pos;
		ll nt = now.nt;
		ll ns = now.ns;
		if (nt !=dp[x][ns]) continue;
		int i = 1;
		for (; ns + i * c[x] < 2500; i++) {
			ll t = i * d[x] + nt;
			ll s1 = ns + i * c[x];
			//cout << t << ' ' << nt <<' '<<i*d[x]<< '\n';
			if (dp[x][s1] > t) {
				dp[x][s1] = t;
				q.push({ x,s1,t });
			}
		}
		if (dp[x][2500] > i * d[x] + nt) {
			q.push({ x,2500,i * d[x] + nt });
			dp[x][2500] = i * d[x] + nt;
		}
		for (i = head[x]; i; i = edge[i].nxt) {
			ll to = edge[i].to;
			ll w = edge[i].w;
			ll t = edge[i].t;
			if (ns >= w && dp[to][ns-w] > nt + t) {
				q.push({ to,ns - w,nt + t });
				dp[to][ns-w] = nt + t;
			}
		}
	}
	rep(i, 2, n) {
		ll ans = 0x7f7f7f7f7f7f7f;
		rep(j, 0, 2500) {
			ans = min(ans, dp[i][j]);
		}
	 cout << ans << '\n';
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'memset' was not declared in this scope
   13 | #define mset(s,_) memset(s,_,sizeof s)
      |                   ^~~~~~
a.cc:49:9: note: in expansion of macro 'mset'
   49 |         mset(dp, 0x7f);
      |         ^~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include<ctime>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

#include <iostream>
#include<map>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<ctime>
using namespace std;
#define ll long long
#define IO std::ios::sync_with_stdio(false);std::cin.tie(0)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
#define mset(s,_) memset(s,_,sizeof s)
#define fi first
#define se second
#define pb push_back

const int maxn = 101;

struct node {
	ll pos, ns, nt;
	bool operator<(const node &T)const{
		return nt > T.nt;
	}
};

struct Edge {
	int to, nxt, w, t;
}edge[maxn << 1];

int n, m, s, head[maxn], mm, c[maxn], d[maxn];
ll dp[100][2600];

void add(int x, int y, int w, int t) {
	edge[++mm] = { y,head[x],w,t };
	head[x] = mm;
}

int main() {
	cin >> n >> m >> s;
	rep(i, 1, m) {
		int x, y, w, t;
		cin >> x >> y >> w >> t;
		add(x, y, w, t);
		add(y, x, w, t);
	}
	rep(i, 1, n) cin >> c[i] >> d[i];
	if (s > 2500) s = 2500;
	mset(dp, 0x7f);
	dp[1][s] = 0;
	priority_queue<node>q;
	q.push({ 1,s,0 });
	while (!q.empty()) {
		node now = q.top();
		q.pop();
		int x = now.pos;
		int nt = now.nt;
		int ns = now.ns;
		if (nt !=dp[x][ns]) continue;
		//cout << x << ' ' << ns << '\n';
		for (int i = head[x]; i; i = edge[i].nxt) {
			int to = edge[i].to;
			int w = edge[i].w;
			int t = edge[i].t;
			if (ns >= w && dp[to][ns-w] > nt + t) {
				q.push({ to,ns - w,nt + t });
				dp[to][ns-w] = nt + t;
			}
		}
		int i = 1;
		for (; ns+i * c[x] < 2500; i++) {
			int t = i * d[x] + nt;
			int s1 = ns + i * c[x];
			if (dp[x][s1] > t) {
				dp[x][s1] = t;
				q.push({ x,s1,t });
			}
		}
		if (dp[x][2500] > i * d[x] + nt) {
			q.push({ x,2500,i * d[x] + nt });
			dp[x][2500] = i * d[x] + nt;
		}
	}
	rep(i, 2, n) {
		ll ans = 0x7f7f7f7f7f7f7f;
		rep(j, 0, 2500) {
			ans = min(ans, dp[i][j]);
		}
		if (ans == 0x7f7f7f7f7f7f7f) cout << -1 << '\n';
		else cout << ans << '\n';
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'memset' was not declared in this scope
   13 | #define mset(s,_) memset(s,_,sizeof s)
      |                   ^~~~~~
a.cc:49:9: note: in expansion of macro 'mset'
   49 |         mset(dp, 0x7f);
      |         ^~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include<ctime>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C

#include <bits/stdc++.h>
#define repr(i,from,to) for(int (i)=(from);(i)<(to);(i)++)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
// const bool debug=true;
const bool debug=false;
#define DEBUG if(debug==true)
#define all(x) begin((x)), end((x))
#define vprint(x) for(auto a:(x)) cout << x << endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;
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;
}

struct nt {
    ll time;
    ll node;
    ll money;
    nt(ll t, ll n, ll m) : time(t), node(n), money(m) {}
};

struct conNt {
    bool operator()(nt const &a, nt const &b) {
        return a.time > b.time;
    }
};


int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m,s;
    cin>>n>>m>>s;
    ll lim = 1LL<<60;
    vector<vector<ll>> mata(n,vector<ll>(n,lim));
    vector<vector<ll>> matb(n,vector<ll>(n,lim));
    vector<ll> exc(n), exctime(n);
    vector<vector<ll>> time(n,vector<ll>(2501, lim));
    rep(i,m) {
        ll u,v,a,b;
        cin>>u>>v>>a>>b;u--;v--; 
        mata[u][v] = mata[v][u] = a;
        matb[u][v] = matb[v][u] = b;
    }
    rep(i,n) {
        cin>>exc[i]>>exctime[i];
    }
    priority_queue<nt, vector<nt>, conNt> pq;
    pq.emplace(0,0,min(2500LL, s));
    ll nxt_time, remain;
    while (!pq.empty()) {
        nt now = pq.top();
        pq.pop();
        if (time[now.node][now.money] < now.time) {
            continue;
        }
        rep(i,n) {
            nxt_time = now.time + matb[now.node][i];
            remain = now.money - mata[now.node][i];
            if (remain >= 0 &&
            nxt_time < time[i][remain]) {
                time[i][remain] = nxt_time;
                pq.emplace(nxt_time, i, remain);
            }
        }
        nxt_time = now.time + exctime[now.node];
        remain = min(2500LL, now.money + exc[now.node]);
        if (time[now.node][remain] > nxt_time) {
            time[now.node][remain] = nxt_time;
            pq.emplace(nxt_time, now.node, remain);
        }
    }

    repr(i, 1, n) {
        ll res = lim;
        rep(j,2500) {
            chmin(res, time[i][j]);
        }
        cout << res << 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;
 
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
 
#define print(a) {for(auto xxxxx : (a)) cout << xxxxx << ' '; cout << '\n';}
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
 
ll next(){ll x; cin >> x; return x;}
const int maxn = 50 + 3, intf = 2e9;
const ll inf = 2e18, mod = 998244353;
const ld eps = 1e-6;
 
#define int ll

struct edge{
	int to , a , b;
};
 
int n , m;
vector <edge> g[maxn];
int c[maxn], d[maxn];
const int C = 4000;
ll dp[maxn][C];
 
int F(int x){
	return min(x , C - 1);
}
 
void solve(){
	int S;
	cin >> n >> m >> S;
 
	for (int i = 0; i < m ; i ++){
		int u , v , a , b;
		cin >> u >> v >> a >> b;
		u-- , v--;
		g[u].pb({v , a , b});
		g[v].pb({u , a , b});
	}
 
	for (int i = 0; i < n; i ++){
		cin >> c[i] >> d[i];
	}
 
	for (int i = 0; i < n; i ++){
		for (int j = 0; j < C; j ++){
			dp[i][j] = inf;
		}
	}
 
	dp[0][F(S)] = 0;
 
	for (int I = 0; I < 2*n; I ++){
 
		for (int i = 0; i < n; i ++){
			for (auto t : g[i]){
				for (int j = 0; j < C; j ++){
					if (t.a > j)
						continue;
 
					dp[t.to][j - t.a] = min(dp[t.to][j - t.a] , dp[i][j] + t.b);
				}
			}
		}
 
		for (int i = 0; i < n; i ++){
			for (int j = 0; j < C; j ++){
				if (j - c[i] < 0)
					continue;
 
				dp[i][j] = min(dp[i][j] , dp[i][j - c[i]] + d[i]);
			}
		}
 
	}
 
	for (int i = 1; i < n; i ++){
		ll ans = inf;
		for (int j = 0; j < C;  j ++){
			ans = min(ans , dp[i][j]);
		}
 
		cout << ans << '\n';
	}
}
 
 
signed main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout.precision(20);
    
    for (int t = 1; t--;) {
    	solve();
    }
 
	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 <queue>
#include <vector>
#include <iostream>

#define int long long

using namespace std;

const int N = 100, K = 3000, INF = 1e9;

struct node
{
    int city;
    int cost;
    int time;
};

vector<node> g[N];
int dp[N][K], c[N], d[N];

void dijkstra(int &s)
{
    dp[1][s] = 0;
    priority_queue<pair<int, pair<int, int>>> q;
    q.push({0, {s, 1}});
    while (!q.empty())
    {
        int utime = -q.top().first;
        int ucoin = q.top().second.first;
        int ucity = q.top().second.second;
        q.pop();
        if (dp[ucity][ucoin] < ctime) continue;
        for (auto v : g[ucity])
        {
            if (ccoin >= v.cost && dp[v.city][ccoin - v.cost] > ctime + v.time)
            {
                dp[v.city][ucoin - v.cost] = utime + v.time;
                q.push({-utime - v.time, {ucoin - v.cost, v.city}});
            }
        }
        if (ucoin + c[ucity] < K && dp[ucity][ucoin + c[ucity]] > utime + d[ucity])
        {
            dp[ucity][ccoin + c[ucity]] = utime + d[ucity];
            q.push({-utime - d[ucity], {ucoin + c[ucity], ucity}});
        }
    }
}

int32_t main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);    
    int n, m, s;
    cin >> n >> m >> s;
    s = min(s, K - 1);
    while (m--)
    {
        int u, v, a, b;
        cin >> u >> v >> a >> b;
        g[u].push_back({v, a, b});
        g[v].push_back({u, a, b});
    }
    for (int i = 1; i <= n; ++i) cin >> c[i] >> d[i];
    for (int i = 1; i <= n; ++i)
    {
        for (int j = 0; j < K; ++j) dp[i][j] = INF;
    }
    dijkstra(s);
    for (int i = 2; i <= n; ++i)
    {
        int ans = INF;
        for (int j = 0; j < K; ++j) ans = min(ans, dp[i][j]);
        cout << ans << '\n';
    }
    return 0;
}


Compiler output:
a.cc: In function 'void dijkstra(long long int&)':
a.cc:32:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |         if (dp[ucity][ucoin] < ctime) continue;
      |             ~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:35:17: error: 'ccoin' was not declared in this scope; did you mean 'ucoin'?
   35 |             if (ccoin >= v.cost && dp[v.city][ccoin - v.cost] > ctime + v.time)
      |                 ^~~~~
      |                 ucoin
a.cc:35:71: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |             if (ccoin >= v.cost && dp[v.city][ccoin - v.cost] > ctime + v.time)
      |                                                                 ~~~~~~^~~~~~~~
a.cc:43:23: error: 'ccoin' was not declared in this scope; did you mean 'ucoin'?
   43 |             dp[ucity][ccoin + c[ucity]] = utime + d[ucity];
      |                       ^~~~~
      |                       ucoin
Language: C

/**
 *     author: qodjf
 *     created: 04.28.2020 00:54:41
 */
#include <bits/stdc++.h>
using namespace std;

string to_string(string s) { return '"' + s + '"'; }

string to_string(const char *s) { return to_string((string)s); }

string to_string(bool b) { return (b ? "true" : "false"); }

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifndef ONLINE_JUDGE
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define dbg(...) 42
#endif

#define mst(x, a) memset(x, a, sizeof(x))

using ll = long long;
using P = pair<int, int>;
using T = tuple<ll, int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr ll LLINF = 0x3f3f3f3f3f3f3f3f;
constexpr ll MOD = 1e9 + 7;

int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};

struct edge {
  int to, cost, t;
  edge(int _to, int _cost, int _time) : to(_to), cost(_cost), t(_time) {}
};

int N, M, S;
int maxCoinsNeeded;
vector<vector<edge>> g;
ll dis[50][10010];

void solve() {
  mst(dis, INF);
  S = min(S, maxCoinsNeeded);
  dis[0][S] = 0;
  priority_queue<T, vector<T>, greater<T>> que;
  que.emplace(0, 0, S);
  while (!que.empty()) {
    auto p = que.top();
    que.pop();
    ll spendT = get<0>(p);
    int pos = get<1>(p), coin = get<2>(p);
    if (spendT > dis[pos][coin]) continue;
    for (const edge &e : g[pos]) {
      int v = e.to;
      int nCoin = min(coin - e.cost, maxCoinsNeeded);
      ll nT = spendT + e.t;
      if (nCoin >= 0 && nT < dis[v][nCoin]) {
        dis[v][nCoin] = nT;
        que.emplace(nT, v, nCoin);
      }
    }
  }

  for (int i = 1; i < N; i++) {
    cout << *min_element(dis[i], dis[i] + maxCoinsNeeded + 1) << endl;
  }
}

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

  cin >> N >> M >> S;
  g.resize(N);
  maxCoinsNeeded = 0;
  for (int i = 0; i < M; i++) {
    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);
    maxCoinsNeeded += 2 * a;
  }
  for (int i = 0; i < N; i++) {
    int c, d;
    cin >> c >> d;
    g[i].emplace_back(i, -c, d);
  }
  solve();
}


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

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <numeric>
#include <random>
#include <bitset>
#include <chrono>

using namespace std;

#define pb push_back
#define x  first
#define y  second
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

#ifndef ONLINE_JUDGE
#include "debug.h"
#else
// #define debug(...) 42
#endif

const int MX =52;
const ll MD= 1e9+7;
const ll MM=2510;
const int MG=2510;

int N,M;
ll S,c[MX],d[MX];
vector<pair<ll,pii>>v[MX];
ll dp[MX][MG];
int main() {
	fast_cin();
	int t=1;
	// cin>>t;
	while(t--)
	{
		cin>>N>>M>>S;
		S=min(2500,S);
		for(int i=0;i<M;i++){
			int x,y,z,tm;
			cin>>x>>y>>z>>tm;
			v[x].pb({y,{z,tm}});
			v[y].pb({x,{z,tm}});
		}
		for(int i=1;i<=N;i++){
			cin>>c[i]>>d[i];
		}
		for(int i=0;i<=N;i++){
			for(int j=0;j<=MM;j++){
				dp[i][j]=1e18;
			}
		}
		using T=pair<ll,pll>;
		priority_queue<T,vector<T>,greater<T>>pq;
		dp[1][S]=0;
		pq.push({0,{1,S}});
		while(!pq.empty())
		{
			T nd=pq.top();
			T tmp=nd;
			tmp.y.x--;
			pq.pop();
			if(dp[nd.y.x][min(MM,nd.y.y+c[nd.y.x])]>nd.x+d[nd.y.x]){
				dp[nd.y.x][min(MM,nd.y.y+c[nd.y.x])]=nd.x+d[nd.y.x];
				pq.push({nd.x+d[nd.y.x],{nd.y.x,min(MM,nd.y.y+c[nd.y.x])}});
			}
			for(auto tp:v[nd.y.x]){
				int id=tp.x;
				int slv=tp.y.x;
				int tme=tp.y.y;
				if(nd.y.y>=slv){
					if(dp[id][nd.y.y-slv]>nd.x+tme){
						dp[id][nd.y.y-slv]=nd.x+tme;
						pq.push({nd.x+tme,{id,nd.y.y-slv}});
					}
				}
			}
		}
		for(int i=2;i<=N;i++){
			ll ans=1e18;
			for(int j=0;j<=2500;j++){
				ans=min(ans,dp[i][j]);
			}
			cout<<ans<<"\n";
		}
	}
	return 0;
}


Compiler output:
a.cc:34:10: fatal error: debug.h: No such file or directory
   34 | #include "debug.h"
      |          ^~~~~~~~~
compilation terminated.