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

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

ll n,m,S;
vector<vector<pair<int,P>>> G;
vector<ll> C,D;

void solve(){
	S = min(S,2500LL);
	vector<vector<ll>> dp(n,vector<ll>(3000,LINF));//dp[i][s] = 0からiに銀貨をs枚持って行くときかかる時間の最小値
	priority_queue<pair<ll,P>, vector<pair<ll,P>>,greater<pair<ll,P>> > q;
	dp[0][S] = 0;
	q.push(mp(0,mp(0,S)));
	while(!q.empty()){
		auto p = q.top();q.pop();
		ll time = p.fs;
		int v = p.sc.fs;
		ll s = p.sc.sc;
		if (time > dp[v][s])continue;

		if (s + C[v] <= 2500){//銀貨を追加する理由があるとき
			ll ns = s + C[v];
			ll ntime = time + D[v];
			if (chmin(dp[v][ns],ntime))q.push(mp(ntime,mp(v,ns)));
		}
		for(auto e:G[v]){
			if (s < e.second.fs)continue;//払えないとき
			int nv = e.fs;
			ll ns = s - e.second.fs;
			ll ntime = time + e.sc.sc;
			if (chmin(dp[nv][ns],ntime))q.push(mp(ntime,mp(nv,ns)));
		}

	}
	for(int i = 1; i < n; i++) {
		ll res = LINF;
		for(int s = 0; s <= 2500; s++) {
			chmin(res,dp[i][s]);
		}
		cout << res << endl;
	}
}

int main(){
	cin>>n>>m>>S;
	G.resize(n);
	for(int i = 0; i < m; i++) {
		ll u,v,a,b;cin>>u>>v>>a>>b;
		u--;v--;
		G[u].pb(mp(v,mp(a,b)));
		G[v].pb(mp(u,mp(a,b)));
	}

	for(int i = 0; i < n; i++) {
		ll c,d;cin>>c>>d;
		C.pb(c);
		D.pb(d);
	}
	solve();
	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;
typedef long long ll;

const ll maxs = 1e5+5;
const ll lmaxs = 20;
ll mod = 1e9+7;
ll oo = 1e15;

#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define I insert
#define endl '\n'

void pre(){
    
}

#define tlll tuple<ll,ll,ll>
#define mt make_tuple
vector<ll> graph[55];
pair<ll,ll> A[55][55];
pair<ll,ll> C[55];
ll dp[55][2505];
ll n,m,S;

void solve(){
    
    cin >> n >> m >> S;

    for(ll i=0;i<n+1;i++){
        for(ll j=0;j<n+1;j++){
            A[i][j] = {-1,-1};
        }
    }

    for(ll i=0;i<m;i++){
        ll x,y;
        cin >> x >> y;
        x--;y--;
        graph[x].pb(y);
        graph[y].pb(x);
        ll a,b;
        cin >> a >> b;
        A[x][y] = {a,b};
        A[y][x] = {a,b};
    }
    for(ll i=0;i<n;i++){
        cin >> C[i].ff >> C[i].ss;
    }

    for(ll i=0;i<55;i++){
        for(ll j=0;j<2505;j++){
            dp[i][j] = oo;
        }
    }
    dp[0][S] = 0;

    priority_queue<tlll,vector<tlll>,greater<tlll> > pq;
    /*
        0 : time
        1 : node
        2 : coins  
    */
    pq.push(mt(0,0,S));
    while (pq.size()){
        tlll curr = pq.top();
        pq.pop();

        ll time_s = get<0>(curr);
        ll s = get<1>(curr);
        ll coins = get<2>(curr);

        if( dp[s][coins] + C[s].ss <  dp[s][min(2500ll,coins + C[s].ff)] ){
            dp[s][min(2500ll,coins + C[s].ff)] =  dp[s][coins] + C[s].ss;
            pq.push(mt(dp[s][coins] + C[s].ss,s,min(2500ll,coins + C[s].ff)));
        }

        for(auto child : graph[s]){
            ll rem_coins = coins - A[s][child].ff;
            if( rem_coins < 0 ) 
                continue;
            ll time_child = time_s + A[s][child].ss;
            if( dp[child][rem_coins] > time_child ){
                dp[child][rem_coins] = time_child;
                pq.push(mt(time_child,child,rem_coins));
            }
        }
    }

    for(ll i=1;i<n;i++){
        ll ans=oo;
        for(ll j=0;j<2501;j++){
            ans = min(ans , dp[i][j]);
        }
        cout << ans << endl; 
    }

}

int main(){
    IOS;
    pre();
    ll T = 1;
    //cin>>T;
    while(T--){
        solve();   
    }
    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>
typedef long long ll;
using namespace std;
const ll MAX = 2500LL;
typedef pair <ll, ll> P;

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

    ll n, m, s;
    cin >> n >> m >> s;
    s = min(s, MAX - 1);

    vector<vector<P>> edge(n * MAX);
    for (int i = 0; i < m; i++) {
        ll u, v, a, b;
        cin >> u >> v >> a >> b;
        u--; v--;
        for (int j = a; j < MAX; j++) {
            edge[u * MAX + j].push_back({v * MAX + j - a, b});
            edge[v * MAX + j].push_back({u * MAX + j - a, b});
        }
    }

    for (int i = 0; i < n; i++) {
        ll c, d;
        cin >> c >> d;
        for (int j = 0; j < MAX; j++) {
            edge[i * MAX + j].push_back({i * MAX + min(j + c, MAX - 1), d});
        }
    }

    vector <ll> ans(n * MAX, 1LL << 60);
    priority_queue <P, vector<P>, greater<P>> q;
    ans[s] = 0;
    q.push({0, s});

    while (!q.empty()) {
        P p = q.top();
        q.pop();
        ll time = p.first;
        int cur = p.second;
        if (ans[cur] < time) continue;
        for (P nxt : edge[cur]) {
            int next_node = nxt.first;
            ll total_time = time + nxt.second;
            if (ans[next_node] > total_time) {
                ans[next_node] = total_time;
                q.push({total_time, next_node});
            }
        }
    }

    for (int i = 1; i < n; i++) {
        ll mn = 1LL << 60;
        for (int j = 0; j < MAX; j++) mn = min(mn, ans[i * MAX + j]);
        cout << mn << '\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

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <cassert>
#include <random>

long long cost[50][50];
long long minutes[50][50];
long long ans[50][50 * 50 + 2];
long long exchange[50];
long long minutes_exchange[50];

int main() {
    int n, m; long long s; std::cin >> n >> m >> s;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) cost[i][j] = -1;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) minutes[i][j] = -1;
    long long sum = 0;
    for (int i = 0; i < m; i++) {
        long long a, b, c, d; std::cin >> a >> b >> c >> d;
        a--; b--;
        cost[a][b] = cost[b][a] = c;
        minutes[a][b] = minutes[b][a] = d;
        sum += c;
    }
    constexpr long long INIT = 1e18;
    if (sum <= s) s = sum;

    for (int i = 0; i < n; i++) {
        std::cin >> exchange[i] >> minutes_exchange[i];
    }
    using Node = std::pair<long long, std::pair<long long, long long>>;
    std::priority_queue<Node, std::vector<Node>, std::greater<Node>> que;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < sum + 2; j++) {
            ans[i][j] = INIT;
        }
    }
    que.push({ 0,{ 0, s } });
    bool vis[50] = {};
    int cnt = 0;
    while (!que.empty()) {
        auto node = move(que.top());
        que.pop();
        long long dist = node.first;
        long long pos = node.second.first;
        long long coin = node.second.second;
        if (ans[pos][coin] != INIT) continue;
        ans[pos][coin] = dist;
        if (!vis[pos]) {
            vis[pos] = true;
            cnt++;
            if (cnt >= n) {
                break;
            }
        }

        for (int i = 0; i < n; i++) {
            if (cost[pos][i] == -1) continue;
            long long nxtcoin = coin - cost[pos][i];
            if (nxtcoin < 0) continue;
            if (ans[i][nxtcoin] != INIT) continue;
            que.push({ dist + minutes[pos][i],{ i, nxtcoin } });
        }

        if (coin < sum) {
            long long nxtcoin = std::min(sum, coin + exchange[pos]);
            long long nxtdist = dist + minutes_exchange[pos];
            if (ans[pos][nxtcoin] != INIT) continue;
            que.push({ nxtdist, {pos, nxtcoin} });
        }
     }
    for (int i = 1; i < n; i++) {
        std::cout << *std::min_element(ans[i], ans[i] + sum + 1) << std::endl;
    }
    return 0;
}


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

#include <iostream>
#include <vector>
#include <queue>

const long long INF = 1LL << 60;

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

    std::vector<std::vector<std::pair<int, int>>> g(N);
    std::vector<int> A(M);
    std::vector<long long> B(M);
    int A_max = 0;
    for (int i = 0; i < M; i++) {
        int U, V;
        std::cin >> U >> V >> A[i] >> B[i];
        U--;
        V--;
        g[U].push_back(std::make_pair(V, i));
        g[V].push_back(std::make_pair(U, i));
        A_max = std::max(A_max, A[i]);
    }

    std::vector<int> C(N);
    std::vector<long long> D(N);
    for (int i = 0; i < N; i++)
        std::cin >> C[i] >> D[i];

    int s_max = A_max * (N - 1);

    std::vector<
        std::vector<long long>
    > dist(N, std::vector<long long>(s_max + 1, INF));

    std::priority_queue<
        std::pair<long long, std::pair<int, int>>,
        std::vector<std::pair<long long, std::pair<int, int>>>,
        std::greater<std::pair<long long, std::pair<int, int>>>
    > que;

    {
        int r = std::min(s_max, S);

        dist[0][r] = 0;

        que.push(
            std::make_pair(
                0,
                std::make_pair(0, r)
            )
        );
    }

    while (!que.empty()) {
        auto p = que.top();
        que.pop();

        int t = p.first;
        int u = p.second.first;
        int s = p.second.second;

        for (auto q : g[u]) {
            int v = q.first;
            int i = q.second;

            if (s < A[i]) continue;

            int r = s - A[i];

            if (dist[u][s] + B[i] < dist[v][r]) {
                dist[v][r] = dist[u][s] + B[i];

                que.push(
                    std::make_pair(
                        dist[v][r],
                        std::make_pair(v, r)
                    )
                );
            }
        }

        {
            int r = std::min(s_max, s + C[u]);

            if (dist[u][s] + D[u] < dist[u][r]) {
                dist[u][r] = dist[u][s] + D[u];

                que.push(
                    std::make_pair(
                        dist[u][r],
                        std::make_pair(u, r)
                    )
                );
            }
        }
    }

    for (int i = 1; i < N; i++) {
        long long ans = INF;

        for (int j = 0; j <= s_max; j++)
            ans = std::min(ans, dist[i][j]);

        std::cout << ans << "\n";
    }
}

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;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define all(a) (a).begin(),(a).end()
typedef long long ll;
#define rep1(i,n) for(int i=1;i<=int(n);++i)

using Cost = ll; // time
struct Edge{
    Cost cost;
    int to;
    int fee;
    bool operator>(const Edge &right)const{
        return cost > right.cost;
    }
};

#define MAX_N 50
#define MAX_C 10000
#define INF ((ll)1e16)

int main(void){
    int n, m, s;
    cin >> n >> m >> s;
    s = min(s,MAX_C);
    vector<vector<Edge>> g(n);
    rep(i,m) {
        ll u,v,fee,cost;
        cin >> u >> v >> fee >> cost;
        u--, v--;
        g[u].push_back((Edge){cost, (int)v, (int)fee});
        g[v].push_back((Edge){cost, (int)u, (int)fee});
    }
    rep(i,n) {
        ll c, d;
        cin >> c >> d;
        g[i].push_back(Edge{d, i, -(int)c});
    }

    // 運賃 Ai <= 50, M = 100 -> 必要最高枚数 = 10000
    // dp[頂点][残り枚数] = かかった時間
    vector<vector<Cost>> dp(n);
    rep(i,n) dp[i] = vector<Cost>(MAX_C+1, INF);

    dp[0][s] = 0;
    priority_queue<Edge,vector<Edge>,greater<Edge>> qu;
    qu.push(Edge{dp[0][s], 0, s});
    while (qu.size()) {
        Edge cur = qu.top(); qu.pop();
        int v = cur.to;
        int rem = cur.fee;
        if (dp[v][rem] < cur.cost) continue;
        for (Edge e : g[v]) {
            Cost next_cost = cur.cost + e.cost;
            int next_rem = min(MAX_C, rem - e.fee);
            if (rem - e.fee >= 0 && dp[e.to][next_rem] > next_cost){
                dp[e.to][next_rem] = next_cost;
                qu.push({next_cost, e.to, next_rem});
            }
        }
    }

    vector<Cost> res(n, INF);
    rep1(i,n-1)rep(j,MAX_C+1){
        res[i] = min(res[i], dp[i][j]);
    }
    rep1(i,n-1){
        cout << res[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 <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<int, int>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
template<typename T> void print(T a) { cout << a << endl; }
template<typename T, typename... Ts> void print(T a, Ts... ts) { cout << a << ' '; print(ts...); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

using Edge = tuple<ll, ll, ll>;
#include <queue>

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n, m, s;
    cin, n, m, s;
    vector<vector<Edge>> g(n);
    REP(i, 0, 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);
    }
    vector<ll> C(n), D(n);
    REP(i, 0, n) {
        cin, C[i], D[i];
    }
    ll Smax = 2510;
    chmin(s, Smax);

    priority_queue<Edge, vector<Edge>, greater<Edge>> pq;  // time, vertex, cost;
    pq.emplace(0, 0, s);
    const ll inf = 1LL << 60;
    auto Tm = make_v(n, Smax + 1, inf);
    Tm[0][s] = 0;
    while (pq.size()) {
        auto [tm, v, c] = pq.top();
        pq.pop();
        if (Tm[v][c] < tm) continue;
        Tm[v][c] = tm;

        {
            ll cc = c + C[v];
            chmin(cc, Smax);
            if (chmin(Tm[v][cc], Tm[v][c] + D[v])) {
                pq.emplace(Tm[v][c] + D[v], v, cc);
            }
        }
        for (auto [nto, aa, bb] : g[v]) {
            if (c >= aa && chmin(Tm[nto][c - aa], tm + bb)) {
                pq.emplace(tm + bb, nto, c - aa);
            }
        }
    }
    REP(i, 1, n) {
        ll ans = inf;
        REP(k, 0, Smax + 1) {
            chmin(ans, Tm[i][k]);
        }

        cout << ans << endl;
    }

    return 0;
}


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

/*
AuThOr GaRyMr
*/
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define LL long long
#define IT iterator
#define PB push_back
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define KEEP while(1)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
#define ALL(a) a.begin(),a.end()
#define POB pop_back
#define ff fflush(stdout)
#define fastio ios::sync_with_stdio(false)
#define debug_pair(A) cerr<<A.FIR<<" "<<A.SEC<<endl;
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
typedef pair<LL,pair<mp,int> > inf;
#define val FIR
#define from SEC.FIR.FIR
#define tim SEC.FIR.SEC
#define to SEC.SEC 
priority_queue<inf,vector<inf>,greater<inf> > q;
int n;
LL dp[51][2501];
vector<pair<int,mp> >  g[51];
int m,s;
int c[51],d[51];
int main(){
	fastio;
	cin>>n>>m>>s;
	s=min(s,2500);
	rb(i,1,m){
		int u,v,a,b;
		cin>>u>>v>>a>>b;
		g[u].PB(II(v,II(a,b)));
		g[v].PB(II(u,II(a,b)));
	}
	rb(i,1,n)
		cin>>c[i]>>d[i];
	
	rb(i,2,n)
	{
		LL res=1000000000000000000ll;
		rep(K,51)
			rep(L,2501)
				dp[K][L]=res;
		rep(j,2500)
			dp[i][j]=0,q.push(II(0,II(II(i,j),i)));
	while(!q.empty()){
		inf now=q.top();
		q.pop();
		int x,y,z;
		x=now.from;
		y=now.tim;
		z=now.to;
		if(now.val!=dp[x][y]) continue;
		if(dp[x][max(0,y-c[x])]>dp[x][y]+d[x]){
			dp[x][max(0,y-c[x])]=dp[x][y]+d[x];
			q.push(II(dp[x][max(0,y-c[x])],II(II(x,max(0,y-c[x])),z)));
		}
		for(auto it:g[x]){
				LL nval;int nx,ny,nz;
				nx=it.FIR;
				ny=y+it.SEC.FIR;
				ny=min(2500,ny);
				nz=z;
				nval=dp[x][y]+it.SEC.SEC;
				if(nval<dp[nx][ny]){
					dp[nx][ny]=nval;
					q.push(II(nval,II(II(nx,ny),nz)));
				}
		}
	}
	rep(j,s+1){
			res=min(res,dp[1][j]);
		}
		if(res<0){
			while(1);
		}
		cout<<res<<endl;
	}
	return 0;
}

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

#include <iostream>
#include <queue>
#include <utility>
#include <vector>
#define MAX_V 300001
#define INF 1000000000000000
using namespace std;
typedef long long ll;
struct edge {
  int to;
  ll cost;
  int coin;
};
typedef pair<ll, int> P;

int V;
vector<edge> G[MAX_V];
ll d[MAX_V], c[50], dd[50];

void dijkstra(int s) {
  priority_queue<P, vector<P>, greater<P> > que;
  fill(d, d + V, INF);
  d[s] = 0;
  que.push(P(0, s));

  while (!que.empty()) {
    P p = que.top();
    que.pop();
    int v = p.second;
    int from = v;
    int vv = v % 5001;
    v = v / 5001;
    if (d[from] < p.first) continue;
    int to;
    to = 5001 * v + min(5000LL, vv + c[v]);
    if (d[to] > d[from] + dd[v]) {
      d[to] = d[from] + dd[v];
      que.push(P(d[to], to));
    }
    for (int i = 0; i < G[v].size(); i++) {
      edge e = G[v][i];
      if (vv - e.coin >= 0 && d[e.to * 5001 + vv - e.coin] > d[from] + e.cost) {
        d[e.to * 5001 + vv - e.coin] = d[from] + e.cost;
        que.push(P(d[e.to * 5001 + vv - e.coin], e.to * 5001 + vv - e.coin));
      }
    }
  }
}
#define MOD 1000000007
using namespace std;

int main() {
  int n, m, s, a, u, v;
  ll b;
  cin >> n >> m >> s;
  V = n * 5001;
  s = min(s, 5000);
  for (int i = 0; i < m; i++) {
    cin >> u >> v >> a >> b;
    u--;
    v--;
    G[u].push_back({v, b, a});
    G[v].push_back({u, b, a});
  }
  for (int i = 0; i < n; i++) {
    cin >> c[i] >> dd[i];
  }
  dijkstra(s);
  for (int i = 1; i < n; i++) {
    ll ans = 10000000000000000;
    for (int j = 0; j <= 5000; j++) {
      ans = min(ans, d[i * 5001 + 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 <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

const ll inf = 1LL << 62;
//struct edge {int to; ll cost;};
struct edge {int to; ll cost;};
struct node {int pos; ll cost;};
bool operator < (const node &a, const node &b){
    return a.cost > b.cost;
}

const int d = 2501;
int N;
vector<ll> dijkstra(vector<vector<edge>> &G, int root, int S){
    vector<ll> ret(G.size(), inf);
    priority_queue<node> pq;
    pq.push({root + N * S, 0});
    while (!pq.empty()) {
        node t = pq.top();
        pq.pop();
        
        if (ret[t.pos] == inf) ret[t.pos] = t.cost;
        else continue;
        
        for (edge e : G[t.pos]) {
            pq.push({e.to, t.cost + e.cost});
        }
    }
    return ret;
}



int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int M;
    ll S;
    cin >> N >> M >> S;
    vector<vector<edge>> G(N * d);
    rep(i, M) {
        int U, V;
        int A;
        ll B;
        cin >> U >> V >> A >> B;
        U--;
        V--;
        rep(i, d) {
            if(i - A >= 0) G[U + N * i].pb({V + N * (i - A), B});
            if(i - A >= 0) G[V + N * i].pb({U + N * (i - A), B});
        }
    }
    rep(i, N) {
        ll C, D;
        cin >> C >> D;
        rep(j, d - 1) {
            G[i + N * j].pb({i + N * (int)min(ll(d) - 1, C + j), D});
        }
    }
    
    vector<ll> ans = dijkstra(G, 0, (int)min((ll)d - 1, S));
    
    vector<ll> ret(N, inf);
    rep(i, N) {
        rep(j, d) {
            ret[i] = min(ret[i], ans[i + j * N]);
        }
    }
    
    rep(i, 1, N) output(ret[i]);
    
    
    
    
    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;
#define int long long
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
template<class T>void chmax(T &a,T b){if(a<b)a=b;}
template<class T>void chmin(T &a,T b){if(a>b)a=b;}
constexpr int INF=1000000000000000000;
constexpr int mod=1000000007;
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int kaijo[2000010];
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
void init_fact(){
    kaijo[0]=1;
    for(int i=1;i<=2000000;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=mod;
    }
}
int modpow(int a,int b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%mod;
    int memo=modpow(a,b/2);
    return memo*memo%mod;
}
int comb(int a,int b){
    if(!kaijo[0])init_fact();
    return kaijo[a]*modpow(kaijo[a-b],mod-2)%mod*modpow(kaijo[b],mod-2)%mod;
}
int inv(int x){
    x=modpow(x,mod-2);
    return x;
}
bool kosa(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){
    double ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
    double tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
    double tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
    double td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
    return tc*td<0&&ta*tb<0;
}
struct edge{int to,silver,cost;};
#define PP pair<int,P>
int n,m,s,c[50],d[50],dist[50][2451];
vector<edge>v[50];
void dijkstra(){
    rep(i,50){
        rep(j,2451){
            dist[i][j]=INF;
        }
    }
    priority_queue<PP,vector<PP>,greater<PP>>q;
    q.push({0,{0,s}});
    dist[0][s]=0;
    while(!q.empty()){
        PP p=q.top();
        q.pop();
        if(dist[p.se.fi][p.se.se]!=p.fi)continue;
        for(int i=0;p.se.se+c[p.se.fi]*i<=2450;i++){
            for(edge e:v[p.se.fi]){
                if(p.se.se+c[p.se.fi]*i-e.silver<0)continue;
                if(dist[e.to][p.se.se+c[p.se.fi]*i-e.silver]>p.fi+d[p.se.fi]*i+e.cost){
                    dist[e.to][p.se.se+c[p.se.fi]*i-e.silver]=p.fi+d[p.se.fi]*i+e.cost;
                    q.push({dist[e.to][p.se.se+c[p.se.fi]*i-e.silver],{e.to,p.se.se+c[p.se.fi]*i-e.silver}});
                }
            }
        }
    }
}
signed main(){
    cin>>n>>m>>s;
    chmin(s,2450ll);
    rep(i,m){
        int u,w,a,b;
        cin>>u>>w>>a>>b;
        u--,w--;
        v[u].pb({w,a,b});
        v[w].pb({u,a,b});
    }
    rep(i,n)cin>>c[i]>>d[i];
    dijkstra();
    rep(i,n){
        if(i){
            int ans=INF;
            rep(j,2451)chmin(ans,dist[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++

#pragma GCC optimize("Ofast")

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>

using namespace std;
using ll = long long;

struct edge{
    ll cost;
    int coin;
    int to;
    edge(){}
    edge(ll cost,int coin,int to):cost(cost),coin(coin),to(to){}
};

int main() {
  ios::sync_with_stdio(false);
cin.tie(nullptr);
    using graph = vector<vector<edge>>;
    int n,m,s;
    cin>>n>>m>>s;
    graph G(n);
    for(int i = 0;i < m;++i) {
        int u,v,a;
        ll b;
        cin>>u>>v>>a>>b;
        --u;--v;
        G[u].emplace_back(b,a,v);
        G[v].emplace_back(b,a,u);
    }
    vector<pair<int,ll>> ryoga(n);
    for(int i = 0;i < n;++i) {
        ll c,d;
        cin>>c>>d;
        if(c>2500)c=2500;
        ryoga[i]=make_pair((int)c,d);
    }
    vector<ll> ans(n,-1);
    vector<vector<ll>> dp(n,vector<ll>(2501,1000000000000LL));
    int cnt=0;

        queue<pair<pair<ll,int>,int>> pq;
        pq.emplace(make_pair(0LL,s),0);
        dp[0][min(2500,s)]=0LL;
        for(int i = 1;s+i*ryoga[0].first <= 5000;++i) {
            dp[0][min(2500,s+i*ryoga[0].first)]=ryoga[0].second*i;
            pq.emplace(make_pair(-ryoga[0].second*i,s+i*ryoga[0].first),0);
            if(s+i*ryoga[0].first>40*n)break;
        }

        //dp.assign(n,vector<ll>(2501,1000000000000LL));

        while(!pq.empty()) {
            auto t=pq.top();

            pq.pop();
            ll time=-t.first.first;
            int co=t.first.second;
            int v=t.second;
            if(ans[v]>time) {
                ans[v]=time;
            }
            if(cnt==n)break;
//cout<<v<<" "<<co<<" "<<time<<endl;
            for(auto x:G[v]) {
                ll nt=time+x.cost;
                int nc=co-x.coin;
                if(nc<0)continue;
                if(nt>dp[x.to][min(2500,nc)])continue;
                dp[x.to][min(2500,nc)]=nt;

                pq.emplace(make_pair(-nt,nc),x.to);
                for(int i = 1;nc+i*ryoga[x.to].first < 37*(n-cnt);++i) {
                    if(nt+ryoga[x.to].second*i>dp[x.to][min(2500,nc+i*ryoga[x.to].first)])continue;
                    dp[x.to][min(2500,nc+i*ryoga[x.to].first)]=nt+ryoga[x.to].second*i;
                    pq.emplace(make_pair(-nt-ryoga[x.to].second*i,nc+i*ryoga[x.to].first),x.to);
                }


            }
        }

        for(int i = 0;i < n-1;++i) {
            cout<<ans[i+1]<<"\n";
        }




    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:23: error: 'class std::queue<std::pair<std::pair<long long int, int>, int> >' has no member named 'top'; did you mean 'pop'?
   74 |             auto t=pq.top();
      |                       ^~~
      |                       pop
Language: C++

#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <numeric>
#include <functional>
#include <math.h>

using namespace std;

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

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (1000000007LL)


int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    int N, M, S;
    cin >> N >> M >> S;
    vector<int> U(M+N), V(M+N), A(M+N), B(M+N);
    for (int m = 0; m < M; ++m) {
        cin >> U[m] >> V[m] >> A[m] >> B[m];
        --U[m]; --V[m];
    }
    for (int n = 0; n < N; ++n) {
        int C, D;
        cin >> C >> D;
        U[M+n] = n;
        V[M+n] = n;
        A[M+n] = -C;
        B[M+n] = D;
    }
    
    int SMax = 10000;
    vector<vector<ll>> DP(N, vector<ll>(SMax, LONG_LONG_MAX));
    for (int s = 0; s <= min(S, SMax-1); ++s) {
        DP[0][s] = 0;
    }
    
    while (1) {
        bool b = false;
        for (int m = 0; m < M+N; ++m) {
            for (int s = 0; s < SMax; ++s) {
                if (s+A[m] < SMax &&
                    s+A[m] >= 0 &&
                    DP[U[m]][s+A[m]] < LONG_LONG_MAX &&
                    DP[V[m]][s] > DP[U[m]][s+A[m]] + B[m]) {
                    b = true;
                    DP[V[m]][s] = DP[U[m]][s+A[m]] + B[m];
                }
                if (U[m] == V[m]) continue;
                if (s+A[m] < SMax &&
                    s+A[m] >= 0 &&
                    DP[V[m]][s+A[m]] < LONG_LONG_MAX &&
                    DP[U[m]][s] > DP[V[m]][s+A[m]] + B[m]) {
                    b = true;
                    DP[U[m]][s] = DP[V[m]][s+A[m]] + B[m];
                }
            }
        }
        
        if (!b) {
            break;
        }
    }
    
    for (int n = 1; n < N; ++n) {
        ll Tmp = LONG_LONG_MAX;
        for (int s = 0; s < SMax; ++s) {
            if (DP[n][s] < Tmp) {
                Tmp = DP[n][s];
            }
        }
        cout << Tmp << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:44:47: error: 'LONG_LONG_MAX' was not declared in this scope
   44 |     vector<vector<ll>> DP(N, vector<ll>(SMax, LONG_LONG_MAX));
      |                                               ^~~~~~~~~~~~~
Language: C


#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<complex>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
#include <numeric>
using namespace std;
using Complex = complex<double>;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1145141919810364364LL;
double PI = acos(-1.0);
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)

ll N, M, S;
ll dist[55][2600];
vector<vector<ll>>E[55];
ll C[55], D[55];
ll MX = 2550;

void dijkstra() {
	min_priority_queue<vector<ll>>q;
	//dist,city,state
	for (int i = 0; i < 55; i++) {
		for (int j = 0; j < 2600; j++) {
			dist[i][j] = inf;
		}
	}
	q.push({0,0,min(S,MX)});
	dist[0][min(S, MX)] = 0;
	while (q.size()) {
		auto v = q.top();
		q.pop();
		ll d = v[0];
		int city = v[1];
		int curmoney = v[2];
		if (dist[city][curmoney] < d)continue;
		fore(x, E[city]) {
			int to = x[0];
			int money = x[1];
			ll cost = x[2];
			if (money > curmoney)continue;
			if (curmoney < MX) {
				if (d + cost < dist[to][curmoney - money]) {
					dist[to][curmoney - money] = d + cost;
					q.push({dist[to][curmoney - money],to,curmoney-money});
				}
			}
			else {
				if (d + cost < dist[to][MX]) {
					dist[to][MX] = d + cost;
					q.push({ dist[to][MX],to,MX });
				}
			}
		}
		if (curmoney < MX){
			if (d + D[city] < dist[city][min(MX, curmoney + C[city])]) {
				dist[city][min(MX, curmoney + C[city])] = d + D[city];
				q.push({ d + D[city],city,min(MX,curmoney + C[city]) });
			}
		}
	}
}


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

	cin >> N >> M >> S;
	for (int i = 0; i < M; i++) {
		int u, v, a, b;
		cin >> u >> v >> a >> b;
		u--, v--;
		E[u].pb({ v,a,b });
		E[v].pb({ u,a,b });
	}
	for (int i = 0; i < N; i++)cin >> C[i] >> D[i];

	dijkstra();
	for (int i = 1; i < N; i++) {
		ll tmp = inf;
		for (int j = 0; j < 2600; j++)tmp = min(tmp,dist[i][j]);
		puts(tmp);
	}
	
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
using P = pair<int, int>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e18;
constexpr long long MOD = 1e9 + 7;

#define MAX 1000

signed main() {
    int n, m, s;
    cin >> n >> m >> s;
    using T = tuple <ll, ll, ll>;
    vector<T> G[n];
    int u, v, a, b;
    rep(i, m) {
        cin >> u >> v >> a >> b;
        u--;
        v--;
        G[u].emplace_back(v, a, b);
        G[v].emplace_back(u, a, b);
    }
    ll c[n], d[n];
    rep(i, n) {
        cin >> c[i] >> d[i];
    }
    ll dist[n][MAX + 1];
    fill(dist[0], dist[n], LINF);
    priority_queue<T, vector<T>, greater<T>> que;
    for (int j = 0;; j++) {
        int nxt = min(s + c[0] * j, (ll)MAX);
        dist[0][nxt] = d[0] * j;
        que.emplace(dist[0][nxt], nxt, 0);
        if (s + c[0] * j > MAX) break;
    }
    while (!que.empty()) {
        T t = que.top();
        que.pop();
        int cnt = get<1>(t), v = get<2>(t);
        if (dist[v][cnt] < get<0>(t)) continue;
        for (int i = 0; i < G[v].size(); i++) {
            int to = get<0>(G[v][i]), need = get<1>(G[v][i]);
            ll cost = get<2>(G[v][i]);
            for (int j = 0;; j++) {
                if (cnt - need < 0) break;
                int nxt = min(cnt - need + c[to] * j, (ll)MAX);
                if (dist[to][nxt] > dist[v][cnt] + cost + d[to] * j) {
                    dist[to][nxt] = dist[v][cnt] + cost + d[to] * j;
                    que.emplace(dist[to][nxt], nxt, to);
                }
                if (cnt - need + c[to] * j > MAX) break;
            }
        }
    }
    for (int v = 1; v < n; v++){
        ll ans = LINF;
        for (int j = 0; j <= MAX; j++) {
            ans = min(ans, dist[v][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 <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <functional>
#include <set>
#include <ctime>

using namespace std;
typedef long long ll;

int __gcd(int x, int y)
{
    if (y == 0) return x;
    return __gcd(y, x % y);
}


int main(){
    int n, m;
    int k = 0;
    ll s;
    int u, v;
    int a, b;
    vector<int> saisoku;
    pair<int, int> eki[51];
    vector<int> order;
    pair<int, int> uv[101][101];
    for (int i = 0; i < 101; i++) {
        for (int j = 0; j < 101; j++) {
            uv[i][j].first = 0;
            uv[i][j].second = 0;
        }
    }
    cin >> n >> m >> s;
    order[0] = 0;
    for (int i = 1; i <= n; i++) {
        order[i] = i; 
    }
    for (int i = 1; i <= m; i++) {
        cin >> u >> v;
        cin >> uv[u][v].first;
        cin >> uv[u][v].second;
    }
    for (int i = 1; i <= n; i++) {
        cin >> eki[i].first;
        cin >> eki[i].second;
    }
    do {
        int jikan = 0;
        ll okane = s;
        for (int i = 1; i <= n - 1; i++) {
            if (uv[order[i]][order[i+1]].first == 0) {
                break;
            }
            while (okane <uv[order[i]][order[i+1]].first) {
                okane += eki[order[i]].first;
                jikan += eki[order[i]].second;
            }
            jikan += uv[order[i]][order[i+1]].second;
            okane -= uv[order[i]][order[i+1]].first;
        }
        saisoku[k++] = jikan;
    } while (next_permutation(order.begin() + 2, order.end()));
    sort(saisoku.begin(), saisoku.end());
    for (int i = 0; i < k; i++) {
        cout << saisoku[i] << endl;
    }
    return 0;
}

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

取りうる値の範囲を求めようとも正確にはちゃんと学校ある方が楽しいよね！何でもしますから！

Compiler output:
main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
    1 | 取りうる値の範囲を求めようとも正確にはちゃんと学校ある方が楽しいよね！何でもしますから！
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define all(a) (a).begin(),(a).end()
typedef long long ll;
#define rep1(i,n) for(int i=1;i<=int(n);++i)
#define lb(s,x) (lower_bound(all(s),x)-s.begin())
#define ub(s,x) (upper_bound(all(s),x)-s.begin())
#define uniq(a) a.erase(unique(all(a)),a.end())
#define bit(k) (1LL<<(k))
const int INF = 1e9;

#define debug(x) cerr<<(#x)<<": "<<(x)<<endl
template<class T,class U>
ostream& operator<<(ostream& o, const pair<T,U> &p){
    o<<"("<<p.first<<", "<<p.second<<")";
    return o;
}
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }

// 運賃 Ai <= 50, M = 100 -> 必要最高枚数 = 10000
// dp[頂点][残り枚数] = かかった時間 

using Cost = ll; // time
struct Edge{
    Cost cost;
    int to;
    int fee;
    bool operator>(const Edge &right)const{
        return cost > right.cost;
    }
};


#define MAX_N 50
#define MAX_C 10000
ll dp[MAX_N][MAX_C+1];

int main(void){
    rep(i, MAX_N)rep(j, MAX_C+1) dp[i][j] = 1e16;
    int n, m, s;
    cin >> n >> m >> s;
    vector<vector<Edge>> g(n);
    rep(i,m) {
        ll u,v,fee,cost;
        cin >> u >> v >> fee >> cost;
        u--, v--;
        g[u].push_back((Edge){cost, (int)v, (int)fee});
        g[v].push_back((Edge){cost, (int)u, (int)fee});
    }
    rep(i,n) {
        ll c, d;
        cin >> c >> d;
        g[i].push_back((Edge){d, i, -(int)c});
    }

    dp[0][min(s,MAX_C)] = 0;
    using P = pair<Cost, pair<int, int>>;
    priority_queue<P,vector<P>,greater<P>> qu;

    qu.push({0,{0,min(s,MAX_C)}});
    while(qu.size()){
        P top = qu.top(); qu.pop();
        Cost cost = top.first;
        int cur = top.second.first;
        int rem = top.second.second;
        // debug(cost);
        // debug(cur);
        // debug(rem);

        if(dp[cur][rem] < cost) continue;
        for(Edge e : g[cur]){
            if(rem - e.fee >= 0 && dp[e.to][min(MAX_C, rem - e.fee)] > cost + e.cost) {
                dp[e.to][min(MAX_C, rem - e.fee)] = cost + e.cost;
                qu.push({cost + e.cost, {e.to, min(MAX_C, rem - e.fee)}});
            }
        }
    }
    vector<Cost> res(n, 1e18);
    rep1(i,n-1)rep(j,MAX_C+1){
        res[i] = min(res[i], dp[i][j]);
    }
    rep1(i,n-1){
        cout << res[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;
typedef long long ll;
const ll INF = 1e18;

ll S;

struct Road {
    ll coin;
    ll time;
};

bool operator<(const Road& x0, const Road& x1) { return x0.time == x1.time ? x0.coin > x1.coin : x0.time < x1.time; }

template <typename T>
struct Graph {
    int V, E;
    struct Edge {
        int from, to;
        T cost;
    };
    vector<vector<Edge>> edge;
    vector<vector<T>> dist;
    vector<Edge> es;

    Graph(int V, int E) : V(V), E(E) {
        edge.assign(V, vector<Edge>(0));
        dist.resize(V, vector<T>(0));
    }

    void input(bool is_direct, bool inputc, bool index0 = false) {
        int a, b;
        T c = 0;
        for (int i = 0; i < E; i++) {
            cin >> a >> b;
            if (inputc) cin >> c;
            if (!index0) a--, b--;
            edge[a].push_back((Edge){a, b, c});
            es.push_back((Edge){a, b, c});
            if (!is_direct) {
                edge[b].push_back((Edge){b, a, c});
                es.push_back((Edge){b, a, c});
            }
        }
        if (!is_direct) E *= 2;
    }

    void add_edge(int from, int to, T cost, bool is_direct) {
        edge[from].push_back({from, to, cost});
        es.push_back({from, to, cost});
        if (!is_direct) {
            edge[to].push_back({to, from, cost});
            es.push_back({to, from, cost});
            E++;
        }
        E++;
    }

    typedef pair<T, int> P;  // (first,second) := (最短距離,頂点番号)
    // 頂点rからの最小距離
    void dijkstra(int r = 0) {
        dist[r].assign(V, {-INF, INF});

        priority_queue<P, vector<P>, greater<P>> que;
        que.push(P({S, 0}, r));
        dist[r][r] = {S, 0};

        while (que.size()) {
            P p = que.top();
            que.pop();
            int v = p.second;
            if (dist[r][v] < p.first) continue;
            for (int i = 0; i < edge[v].size(); i++) {
                Edge e = edge[v][i];
                T add = {dist[r][v].coin + e.cost.coin, dist[r][v].time + e.cost.time};
                if (add.coin < 0) continue;
                if (add < dist[r][e.to]) {
                    dist[r][e.to] = add;
                    que.push(P(dist[r][e.to], e.to));
                }
            }
        }
    }
};

int main() {
    int N, M;
    cin >> N >> M >> S;
    Graph<Road> g(N * 5010, 0);
    for (int i = 0; i < M; i++) {
        int u, v;
        Road r;
        cin >> u >> v >> r.coin >> r.time;
        r.coin *= -1;
        u--, v--;
        for (int j = 0; j < 5010; j++) {
            g.add_edge(u + j * N, v + j * N, r, false);
        }
    }
    for (int i = 0; i < N; i++) {
        ll C, D;
        cin >> C >> D;
        for (int j = 1; j < 5010; j++) {
            g.add_edge(i + (j - 1) * N, i + j * N, {C, D}, true);
        }
    }
    g.dijkstra();
    for (int i = 1; i < N; i++) {
        ll ans = INF;
        for (int j = 0; j < 5010; j++) ans = min(ans, g.dist[0][i + j * N].time);
        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;

typedef long long ll;
typedef long double ld;

ll cost[55][55];
ll tajm[55][55];
ll kosta[55];
int vreme[55];

ll n, m, s;

ll dist[55][2505];

const ll INF = 1000000000000000000LL;

vector <ll> graf[55];

void dijkstra(){
    if(s > 50*n) s = 50*n;
    for(ll i=1; i<=n; i++){
        for(ll j=0; j<=50*n; j++){
            dist[i][j] = INF;
        }
    }
    dist[1][s] = 0;
    set <pair <ll, pair <ll, ll>>> q;
    q.insert({0, {1, s}});
    while(!q.empty()){
        auto x = *q.begin();
        q.erase(q.begin());
        ll v = x.second.first;
        ll j = x.second.second;
        ll jos = min(50*n, j+kosta[v]);
        if(dist[v][jos] > dist[v][j] + vreme[v]){
            q.erase({dist[v][jos], {v, jos}});
            dist[v][jos] = dist[v][j] + vreme[v];
            q.insert({dist[v][jos], {v, jos}});
        }
        for(auto c : graf[v]){
            ll jos = j-cost[v][c];
            if(jos < 0) continue;
            if(dist[c][jos] > dist[v][j] + tajm[v][c]){
                q.erase({dist[c][jos], {c, jos}});
                dist[c][jos] = dist[v][j] + tajm[v][c];
                q.insert({dist[c][jos], {c, jos}});
            }
        }
    }
}

int main(){
    ios_base::sync_with_stdio(false), cin.tie(0);
    cout.precision(10);
    cout << fixed;

    cin >> n >> m >> s;
    for(ll i=1; i<=m; i++){
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        graf[a].push_back(b);
        graf[b].push_back(a);
        cost[a][b] = c;
        tajm[a][b] = d;
        tajm[b][a] = d;
        cost[b][a] = c;
    }
    for(ll i=1; i<=n; i++){
        cin >> kosta[i] >> vreme[i];
    }
    dijkstra();
    for(int i=2; i<=n; i++){
        ll res = dist[i][0];
        for(int j=0; j<=50*n; j++) res = min(res, dist[i][j]);
        cout << res << "\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++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i <= (n); ++i)
#define Sort(Array) sort(Array.begin(), Array.end())
#define Reverse(a) reverse(a.begin(), a.end())
#define out(ans) cout << ans << endl;

int main(){
  while(n < 2)
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 |   while(n < 2)
      |         ^
      |         yn
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
Language: C

#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define endl "\n"
#define ll long long
#define sz(s) (int)(s.size())
#define INF 0x3f3f3f3f3f3f3f3fLL
#define all(v) v.begin(),v.end()
#define watch(x) cout<<(#x)<<" = "<<x<<endl
const int dr[] { -1, -1, 0, 1, 1, 1, 0, -1 };
const int dc[] { 0, 1, 1, 1, 0, -1, -1, -1 };
#if __cplusplus >= 201402L
template<typename T>
vector<T> create(size_t n) {
	return vector<T>(n);
}
template<typename T, typename ... Args>
auto create(size_t n, Args ... args) {
	return vector<decltype(create<T>(args...))>(n, create<T>(args...));
}
#endif
void run() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifdef EZZAT
	freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
#else
#endif
}
struct edge {
	int from, to;
	ll a, b;
};

struct state {
	int cur;
	ll silver, time;
	int buyIdx;
	state(int cur, ll silver, ll time, int buyIdx) :
			cur(cur), silver(silver), time(time), buyIdx(buyIdx) {
	}
	bool operator<(const state &o) const {
		return time > o.time;
	}
};

const int N = 51;
vector<edge> adj[N];
pair<ll, ll> cost[N];
ll dis[N][N * N + 1][N];
int s;
void dijkstra() {
	memset(dis, INF, sizeof(dis));
	priority_queue<state> q;
	q.push(state(1, s, 0, 1));
	dis[1][s][1] = 0;
	while (sz(q)) {
		int cur = q.top().cur;
		ll silver = q.top().silver;
		ll time = q.top().time;
		int buyIdx = q.top().buyIdx;
		q.pop();
		if (dis[cur][silver][buyIdx] < time)
			continue;
		for (auto ch : adj[cur]) {
			ll nxtTime = (time + ch.b);
			ll nxtSilver = (silver - ch.a);
			if (nxtSilver < 0) {
				ll cntNum = (-nxtSilver + cost[buyIdx].first - 1)
						/ cost[buyIdx].first;
				nxtTime += cntNum * cost[buyIdx].second;
				nxtSilver += cntNum * cost[buyIdx].first;
				nxtSilver = min(nxtSilver, 1LL * N * N);
			}
			if (dis[ch.to][nxtSilver][buyIdx] > nxtTime) {
				dis[ch.to][nxtSilver][buyIdx] = nxtTime;
				q.push(state(ch.to, nxtSilver, nxtTime, buyIdx));
			}
			if (dis[ch.to][nxtSilver][ch.to] > nxtTime) {
				dis[ch.to][nxtSilver][ch.to] = nxtTime;
				q.push(state(ch.to, nxtSilver, nxtTime, ch.to));
			}
		}
	}
}
int main() {
	run();
	int n, m;
	cin >> n >> m >> s;
	s = min(s, N * N);
	while (m--) {
		edge e;
		cin >> e.from >> e.to >> e.a >> e.b;
		adj[e.from].push_back(e);
		swap(e.from, e.to);
		adj[e.from].push_back(e);
	}
	for (int i = 1; i <= n; i++)
		cin >> cost[i].first >> cost[i].second;
	dijkstra();
	for (int i = 2; i <= n; i++) {
		ll mn = INF;
		for (int si = 0; si <= N * N; si++)
			for (int j = 1; j <= n; j++)
				mn = min(mn, dis[i][si][j]);
		cout << mn << "\n";
	}
}


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