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

#pragma optimize("", off)
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/STACK:36777216")

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

int32_t main(){

   int n, p = 2019;
   string s;
   cin >> s;
   n = (int)(s.size());

   long long ans = 0;

      vector<int> a(n);
      int pw = 1;
      for (int i = n-1; i >= 0; --i)
      {
         a[i] = (s[i]-'0');
         a[i] *= pw;
         a[i] %= p;
         pw *= 10;
         pw %= p;
      }

      map<int, int> freq;
      freq[0] = 1;

      int sum = 0;
      for (int i = 0; i < n; ++i)
      {
         sum += a[i];
         sum %= p;
         if(freq.count(sum)){
            ans += freq[sum];
         }  
         freq[sum]++;
      }

   cout<<ans;

   return 0;
}


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:7:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::__cxx11::basic_string<char>::_Alloc_hider::~_Alloc_hider()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = char]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/string:54:
/usr/include/c++/14/bits/basic_string.h:186:14: note: called from here
  186 |       struct _Alloc_hider : allocator_type // TODO check __is_final
      |              ^~~~~~~~~~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
string s;
int a[200005],d[200005],b[200005];
ll ans;
int main(void){
    cin>>s;
    d[s.size()-1]=1;
    for(int i=s.size()-1;i>=0;i--){
        a[i]=s[i]-48;
        if(i!=s.size()-1){
            d[i]=d[i+1]*10%2019;
            d[i+1]=d[i+1]*a[i+1]%2019;
        }
    }
    d[0]=d[0]*a[0];
    /*for(int i=0;i<s.size();i++){
        cout<<d[i]<<endl;
    }*/
    for(int i=0;i<s.size();i++){
        b[i+1]=(b[i]+d[i])%2019;
    }
    sort(b,b+s.size()+1);
    int t=1;
    for(int i=1;i<s.size()+1;i++){
        if(b[i]==b[i-1]){
            t++;
        }else{
            ans+=(t-1)*t/2;
            t=1;
        }
    }
    ans+=(t-1)*t/2;
    cout<<ans<<endl;
    
}


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

#include <bits/stdc++.h>

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

using namespace std;

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

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

template <int mod>
struct ModInt {
  int x;
  ModInt(): x(0) {}
  ModInt(long long a) { x = a % mod; if (x < 0) x += mod; }
  ModInt &operator+=(ModInt that) { x = (x + that.x) % mod; return *this; }
  ModInt &operator-=(ModInt that) { x = (x + mod - that.x) % mod; return *this; }
  ModInt &operator*=(ModInt that) { x = (long long) x * that.x % mod; return *this; }
  ModInt &operator/=(ModInt that) { return *this *= that.inverse(); }
  ModInt inverse() {
    int a = x, b = mod, u = 1, v = 0;
    while (b) { int t = a / b; a -= t * b; u -= t * v; swap(a, b); swap(u, v); }
    return ModInt(u);
  }
  #define op(o, p) ModInt operator o(ModInt that) { return ModInt(*this) p that; }
    op(+, +=) op(-, -=) op(*, *=) op(/, /=)
  #undef op
  friend ostream& operator<<(ostream &os, ModInt m) { return os << m.x; }
};

using mint = ModInt<2019>;

void solve() {
  string s;
  cin >> s;
  int n = sz(s);
  vector<mint> mod(n + 1);
  rrep(i, n) {
    mint x = s[i] - '0';
    mod[i] = mod[i + 1] + exp((mint) 10, n - i - 1) * x;
  }
  i64 ans = 0;
  map<int, int> cnt;
  repc(i, n) cnt[mod[i].x]++;
  each(c, cnt) {
    ans += (i64) c.second * (c.second - 1) / 2;
  }
  cout << ans << endl;
}

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

#include <bits/stdc++.h>
#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; }

const ll mod = 2019;

ll sum(ll n) {
  return n * (n - 1) / 2;
}

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

  string s;
  cin >> s;

  map<ll, ll> cnt;
  cnt[0]++;
  ll res = 0, keta = 1;
  int n = s.length();
  repr(i, n - 1) {
    res = (res + (s[i] - '0') * keta) % mod;
    cnt[res]++;
    keta = (keta * 10) % mod;
  }
  ll ans = 0;
  for (auto it = cnt.begin(); it != cnt.end(); it++) {
    ans += sum(it->second);
  }
  cout << ans << '\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;
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;
}
using ll = long long;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
constexpr int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

ll pow_mod(ll n, ll k, ll mod) {
    if(k == 0) {
        return 1;
    } else if(k % 2 == 1) {
        return pow_mod(n, k - 1, mod) * n % mod;
    } else {
        ll t = pow_mod(n, k / 2, mod);
        return t * t % mod;
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    ll n=s.size();
    ll p=2019;
    vector<ll> a(n);
    for(ll i = 0; i < n; i++) {
        a[i] = (ll)(s[i] - '0');
    }
    reverse(ALL(a));
    vector<int> sum(n + 1, 0);
    for(ll i = 0; i < n; i++) {
        sum[i + 1] = sum[i] + a[i] * pow_mod(10, i, p) % p;
        sum[i + 1] %= p;
    }
    map<ll, ll> mp;
    for(ll i = 0; i < n + 1; i++) {
        // cout << sum[i] << " ";
        mp[sum[i]]++;
    }
    // cout << endl;
    ll ans = 0;
    if(p == 2 || p == 5) {
        for(int i = 0; i < n; i++) {
            if(a[i] % p == 0) {
                ans += n - i;
            }
        }
        cout << ans << endl;
        return 0;
    }
    for(const auto &p : mp) {
        ans += (p.second - 1) * p.second / 2;
    }
    cout << ans << endl;
}


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

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

typedef long long ll;

int main(){
  string s;
  cin >> s;
  long long  count = 0,number,sum=0;
  long long length = s.length();
  for(int i=0;i<length;i++){
    number=s[i]-'0';
    count=s[i]-'0';
    for(int j=i+1;j<length;j++){
      number = number*10+s[j]-'0';
      count += s[j]-'0';
      if(count%3==0) {
	if(number%2019==0) sum++;
      }
    }
  }
  cout << sum << 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 <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    string s;
    cin >> s;
    int n = s.size();
    map<int, int> m;
    int val = 0;
    vector<int> vs(n+1);
    ll aaa = 1;
    for (int i = n-1; i >= 0; --i) {
        val = (val + (s[i]-'0')*aaa)%2019;
        aaa = (aaa*10)%2019;
        m[val]++;
        vs[i] = val;
    }
    ll ans = 0;
    for (int i = n-1; i >= 0; --i) {
        ans += m[vs[i+1]];
        m[vs[i]]--;
    }
    cout << ans << "\n";
    return 0;
}

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

#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

constexpr int MOD_TYPE = 1;
constexpr ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
constexpr int INF = (int)1e9;
constexpr ll LINF = (ll)4e18;
constexpr ld PI = acos(-1.0);
constexpr ld EPS = 1e-11;
constexpr int Dx[] = {0, 0, -1, 1, -1, 1, -1, 1, 0};
constexpr int Dy[] = {1, -1, 0, 0, -1, -1, 1, 1, 0};

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << "\n"
#define Yes(n) cout << ((n) ? "Yes" : "No") << "\n"
#define possible(n) cout << ((n) ? "possible" : "impossible") << "\n"
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << "\n"
#define Yay(n) cout << ((n) ? "Yay!" : ":(") << "\n"
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << "\n";

#pragma endregion

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

  string s;
  cin >> s;
  int n = s.length();
  reverse(all(s));
  ll csum[200010];
  csum[0] = 0;
  ll cnt[2019] = {};
  cnt[0]++;
  ll pow10 = 1;
  rep(i, n)
  {
    csum[i + 1] = (csum[i] + (s[i] - '0') * pow10) % 2019;
    cnt[csum[i + 1]]++;
    pow10 = pow10 * 10 % 2019;
  }
  ll ans = 0;
  rep(i, 2019)
  {
    ans += cnt[i] * (cnt[i] - 1) / 2;
  }
  cout << ans << endl;
  return 0;
}


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

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>
#include <cmath>
#include <numeric>

using namespace std;

#define int long long
#define rep(i, n) for (int i=0;i<(int)n;++i)
#define rep1(i, n) for (int i=1;i<=(int)n;++i)
#define rrep(i, n) for (int i=(int)n-1;i>=0;--i)
#define rrep1(i, n) for (int i=n;i>=1;--i)
#define range(i, l, r) for (int i=l;i<(int)r;++i)
#define rrange(i, l, r) for (int i=(int)r-1;i>=(int)l;--i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using vi=vector<int>;
using pii=pair<int, int>;

bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
int read(){int a;scanf("%lld",&a);return a;}

int counter[200010];
int rui[200010];
const int P=2019;
int ans;
int N;

signed main()
{
	string S; cin>>S;
	N=S.size();
	S = ' ' + S;
	counter[0]++;
	int ten = 1;
	for (int i = N; i >= 1; --i) {
		rui[i] += rui[i + 1];
		rui[i] += (S[i] - '0') * ten;
		rui[i] %= P;

		ans += counter[rui[i]];
		counter[rui[i]]++;

		ten *= 10;
		ten %= P;
	}

	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;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define FORI(i,v) for (auto i = v.begin(); i != v.end(); i++)
#define ALL(v) v.begin(), v.end()
#define CHMIN(x,y) x = min(x, y)
#define CHMAX(x,y) x = max(x, y)
#define YES(b) cout << ((b) ? "YES" : "NO") << endl
#define Yes(b) cout << ((b) ? "Yes" : "No") << endl
#define DOUBLE(d) cout << fixed << setprecision(15) << (d) << endl

string S;

ll solve() {
    int sz = S.size();
    vi val(sz);
    int i = 0, v = 0;

    ll ret = 0;
    while (i < sz) {
        v = (v * 10 + (S[i] - '0')) % 2019;
        val[i] = v;
        if (v == 0) ret++;
        i++;
    }

    vi check(2019);
    int k = 1;
    REPR (i, sz) {
        check[(val[i] * k) % 2019]++;
        (k *= 10) %= 2019;
    }

    REP (i, 2019) ret += check[i] * (check[i]-1)/2;
    return ret;
}

int main() {
    cin >> S;
    cout << solve() << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
template<class T> inline bool chmin(T&x,T y){if(x>y){x=y;return true;}return false;}
template<class T> inline bool chmax(T&x,T y){if(x<y){x=y;return true;}return false;}
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    int n=s.length();
    vector<int> a(n+1);
    int tmp=1;
    ll c[2019]={1};
    ifr(i,n){
        a[i]=a[i+1];
        a[i]+=(s[i]-'0')*tmp;
        a[i]%=2019;
        tmp*=10;
        tmp%=2019;
        c[a[i]]++;
    }
    ll ans{};
    fr(i,2019) ans+=c[i]*(c[i]-1)/2;
    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>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main() {
    int N,P=2019;
    string S;
    cin >> S;
    N=S.size();

    ll ans = 0;
    if (P == 2 || P == 5) {
        REP(i, 0, N) if ((S[N - i - 1] - '0') % P == 0) ans += N - i;
    } else {
        vector<ll> mods(P, 0);

        ll cur = 0, coef = 1;
        mods[cur]++;
        REP(i, 0, N) {
            cur = (cur + coef * (S[N - i - 1] - '0') % P) % P;
            coef = coef * 10 % P;
            mods[cur]++;
        }

        REP(i, 0, P) {
            ans += mods[i] * (mods[i] - 1) / 2;
        }
    }
    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++

4 6 1000000000
1 2 50 1
1 3 50 5
1 4 50 7
2 3 50 2
2 4 50 4
3 4 50 3
10 2
4 4
5 5
7 7

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 4 6 1000000000
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1e18
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<int, int>
#define PP pair<int,int>
#define T tuple<int,int,int> 
using namespace std;

struct Edge{
    int to,a,b;
    Edge(int to, int a, int b):to(to),a(a),b(b){}
};

struct Data{
    int v,s; ll x;
    Data(int v, int s, ll x):v(v),s(s),x(x){}
    bool operator<(const Data& a) const{
        return x > a.x;
    }
};

vector<Edge> res[50];
ll dp[50][2510];

int main(){
    int n,m,s; cin >> n >> m >> s;
    rep(i,m){
        int u,v,a,b; cin >> u >> v >> a >> b;
        u--; v--;
        res[u].emplace_back(v,a,b);
        res[v].emplace_back(u,a,b);
    }
    vector<int> c(n),d(n);
    rep(i,n) cin>> c[i] >> d[i];

    rep(i,n)rep(j,2510) dp[i][j]=INF;
    s=min(s,2505);

    priority_queue<Data> q;

    auto push = [&](int v, int s, ll x){
        if(s<0) return;
        if(dp[v][s]<=x) return;
        dp[v][s]=x;
        q.emplace(v,s,x);
    };
    push(0,s,0);
    while(!q.empty()){
        Data hoge = q.top();
        q.pop();
        int v=hoge.v, s=hoge.s;
        ll x = hoge.x;
        if(dp[v][s]!=x) continue;
        //両替
        //int ns=min(s+c[v],2505);
        push(v,ns,x+d[v]);
        // 移動
        for(Edge e : res[v]){
            push(e.to, s-e.a, x+e.b);
        }
    }
    for(int i=1; i<n; i++){
        ll ans=INF;
        rep(j,2510){
            ans=min(ans,dp[i][j]);
        }
        cout << ans << endl;
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:16: error: 'ns' was not declared in this scope; did you mean 's'?
   60 |         push(v,ns,x+d[v]);
      |                ^~
      |                s
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll,ll>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ASC(x) sort(ALL((x)))
#define DESC(x) sort(ALL((x)),greater<ll>())
#define REV(x) reverse(ALL((x)))
#define pb push_back

#define Z 2500

int main()
{
    ll N, M, S;
    cin >> N >> M >> S;
    vector<vector<edge>> G(N);
    REP(i,0,M) {
        ll u, v, a, b;
        cin >> u >> v >> a >> b;
        --u; --v;
        G[u].pb(edge(v, pll(a, b)));
        G[v].pb(edge(u, pll(a, b)));
    }
    vec C(N), D(N);
    REP(i,0,N) cin >> C[i] >> D[i];

    S = MIN(S,Z);
    mat dp(N, vec(Z+1, INF));
    priority_queue<pair<ll,pll>, vector<pair<ll,pll>>, greater<pair<ll,pll>>> Q;
    dp[0][S] = 0;
    Q.push(make_pair(0, pll(0, S)));

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

        if(s + C[v] <= Z) {
            ll ns = s + C[v];
            ll ntime = time + D[v];
            if(dp[v][ns] > ntime) {
                dp[v][ns] = ntime;
                Q.push(make_pair(ntime, pll(v, ns)));
            }
        }

        FORR(e,G[v]) {
            if(s < e.second.first) continue;
            ll nv = e.first;
            ll ns = s - e.second.first;
            ll ntime = time + e.second.second;
            if(dp[nv][ns] > ntime) {
                dp[nv][ns] = ntime;
                Q.push(make_pair(ntime, pll(nv, ns)));
            }
        }

    }

    REP(v,1,N) {
        ll res = INF;
        REP(s,0,Z+1) res = MIN(res,dp[v][s]);
        PR(res);
    }

    return 0;
}

/*



*/

Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: 'edge' was not declared in this scope
   32 |     vector<vector<edge>> G(N);
      |                   ^~~~
a.cc:32:19: error: template argument 1 is invalid
a.cc:32:19: error: template argument 2 is invalid
a.cc:32:23: error: template argument 1 is invalid
   32 |     vector<vector<edge>> G(N);
      |                       ^~
a.cc:32:23: error: template argument 2 is invalid
a.cc:37:10: error: invalid types 'int[ll {aka long long int}]' for array subscript
   37 |         G[u].pb(edge(v, pll(a, b)));
      |          ^
a.cc:38:10: error: invalid types 'int[ll {aka long long int}]' for array subscript
   38 |         G[v].pb(edge(u, pll(a, b)));
      |          ^
a.cc:64:17: error: invalid types 'int[ll {aka long long int}]' for array subscript
   64 |         FORR(e,G[v]) {
      |                 ^
a.cc:14:32: note: in definition of macro 'FORR'
   14 | #define FORR(i,v) for(auto (i):v)
      |                                ^
Language: C

#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind 
#define Pint pair<int,int>
#define Pll pair<llint,llint>
#define keta(a)  fixed << setprecision(a)
constexpr auto INF = 1000000000000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！

struct edge { int to;llint kane, cost; };
whei(edge) G;
hei(llint) C, D;
llint sum;
void dijkdtra(vector<vector<llint>>& d, llint s) {
	priority_queue<pair<pair<int,int>,llint>, vector<pair<pair<int, int>, llint>>, greater< pair<pair<int, int>, llint>>> que;
	d[0][s] = 0;//スタートの距離はもちろんzero
	que.push(pair<pair<int,int>,int>(pair<int,int>(0,(int)s),0));
	auto push = [&](int v, int c, int t) {
		if (c < 0)return;
		if (d[v][c] <= t)return;
		d[v][c] = t;
		que.push(pair<pair<int, int>, int>(pair<int, int>(v,c),t));
	};
	while (!que.empty()) {
		pair<pair<int, int>, int> p = que.top();
		que.pop();
		int V = p.first.first;
		llint a = min(C[V] + p.first.second, sum);
		push(V,a,p.second+ D[V]);
		for (edge x : G[V])push(x.to, p.first.second - x.kane, p.second + x.cost);
	}
}

signed  main() {
	int n, m;
	cin >> n >> m;
	llint s;
	cin >> s;
	G.resize(n);
	rep(i, 0, m) {
		int v, u;
		llint a, b;
		cin >> u >> v >> a >> b;
		u--; v--;
		G[u].push_back(edge{ v,a,b});
		G[v].push_back(edge{ u,a,b});
	}
	C.resize(n);
	D.resize(n);
	sum = (llint)(n - 1) * 50;
	rep(i, 0, n)cin >> C[i] >> D[i];
	whei(llint) d(n, hei(llint)(sum + 1, INF));

	s = min(s,sum);
	dijkdtra(d, s);
	rep(i, 1, n) {
		llint ans = INF;
		rep(j, 0, sum + 1)ans = min(ans, d[i][j]);
		cout << ans << endl;
	}
	return 0;
}

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

#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind 
#define Pint pair<int,int>
#define Pll pair<llint,llint>
#define keta(a)  fixed << setprecision(a)
constexpr auto INF = 1000000000000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！

struct edge { int to;llint kane, cost; };
struct usi { llint v, c; llint t; };
whei(edge) G;
hei(llint) C, D;
llint sum;
void dijkdtra(vector<vector<llint>>& d, llint s) {
	priority_queue<usi, vector<usi>, greater<usi>> que;
	d[0][s] = 0;//スタートの距離はもちろんzero
	que.push(usi{0, (int)s, 0});
	auto push = [&](int v, int c, int t) {
		if (c < 0)return;
		if (d[v][c] <= t)return;
		d[v][c] = t;
		que.push(usi{ v,c,t });
	};
	while (!que.empty()) {
		usi p = que.top();
		que.pop();
		int V = p.v;
		llint a = min(C[V] + p.c, sum);
		push(p.v, a, p.t+ D[V]);
		for (edge x : G[V])push(x.to, p.c - x.kane, p.t + x.cost);
	}
}

signed  main() {
	int n, m;
	cin >> n >> m;
	llint s;
	cin >> s;
	G.resize(n);
	rep(i, 0, m) {
		int v, u;
		llint a, b;
		cin >> u >> v >> a >> b;
		u--; v--;
		G[u].push_back(edge{ v,a,b });
		G[v].push_back(edge{ u,a,b });
	}
	sum = (n - 1) * 50;
	rep(i, 0, n)cin >> C[i] >> D[i];
	whei(llint) d(n, hei(llint)(sum + 1, INF));

	s = min(s,sum);
	dijkdtra(d, s);
	rep(i, 1, n) {
		llint ans = INF;
		rep(j, 0, sum + 1)ans = min(ans, d[i][j]);
		cout << ans << endl;
	}
	return 0;
}

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

#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

const ll INF = 1e18;
const int MAX_S = 2505;
ll dp[55][MAX_S+5];

int main() {
    int n, m, s;
    cin >> n >> m >> s;
    vector<vector<tuple<int, int, int>>> E(n);
    rep(i, m) {
        int u, v, a, b;
        cin >> u >> v >> a >> b; 
        --u; --v;
        E[u].emplace_back(v, a, b);
        E[v].emplace_back(u, a, b);
    }
    vector<int> C(n), D(n);
    rep(i, n) cin >> C[i] >> D[i];
    rep(i, n) rep(j, MAX_S) dp[i][j] = INF;
    s = min(s, MAX_S);
    dp[0][s] = 0;
    priority_queue<tuple<int, int, int>, vector<tuple<ll, int, int>>, greater<tuple<int, int, int>>> que;
    que.push(make_tuple(0ll, s, 0));
    while (!que.empty()) {
        ll t; 
        int s, v;
        auto q = que.top(); que.pop();
        tie(t, s, v) = q;
        if (dp[v][s] < t) continue;
        int ns = min(s+C[v], MAX_S);
        ll nt = t + D[v];
        if (dp[v][ns] > nt) {
            dp[v][ns] = nt;
            que.push(make_tuple(nt, ns, v));
        }
        for (auto e: E[v]) {
            int u, a, b;
            tie(u, a, b) = e;
            ns = s - a;
            if (ns < 0) continue;
            nt = t + b;
            if (dp[u][ns] > nt) {
                dp[u][ns] = nt;
                que.push(make_tuple(nt, ns, u));
            }
        }
    }
    rep(i, n) {
        if (!i) continue;
        ll ans = INF;
        rep(j, MAX_S) ans = min(ans, dp[i][j]);
        cout << ans << endl;
    }
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h: In instantiation of 'class std::priority_queue<std::tuple<int, int, int>, std::vector<std::tuple<long long int, int, int> >, std::greater<std::tuple<int, int, int> > >':
a.cc:27:102:   required from here
   27 |     priority_queue<tuple<int, int, int>, vector<tuple<ll, int, int>>, greater<tuple<int, int, int>>> que;
      |                                                                                                      ^~~
/usr/include/c++/14/bits/stl_queue.h:520:67: error: static assertion failed: value_type must be the same as the underlying container
  520 |       static_assert(is_same<_Tp, typename _Sequence::value_type>::value,
      |                                                                   ^~~~~
/usr/include/c++/14/bits/stl_queue.h:520:67: note: 'std::integral_constant<bool, false>::value' evaluates to false
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;

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

struct edge
{
    int to;
    int change;
    int time;
    edge(int to, int c, int t): to(to), change(c), time(t) {}

};

struct data
{
    int v;       // 今の頂点
    int change;  // 今の銀貨の枚数
    long long time;    // 今のかかった時間

    data(int v, int change, int time): v(v), change(change), time(time) {}

    bool operator < (const data& right) const {
        return time > right.time;
    }
};

int main()
{
    int N, M, S;
    cin >> N >> M >> S;
    vector<vector<edge>> G(N);
    REP(i, M){
        int U, V, A, B;
        cin >> U >> V >> A >> B;
        --U, --V;
        G[U].emplace_back(V, A, B);
        G[V].emplace_back(U, A, B);
    }
    vector<int> C(N), D(N);
    REP(i, N) cin >> C[i] >> D[i];


    int mx = 50*(N-1);  // 高々 50*(N-1) 枚の銀貨があれば十分

    // dp[i][j] = i まで銀貨 j 枚で行ける最短の時間
    vector<vector<long long>> dp(N, vector<long long>(mx+1, 1e+18));
    priority_queue<data> q;
    q.emplace(0, min(S, mx), 0);
    while(!q.empty()){
        auto top = q.top(); q.pop();
        int v = top.v;
        int c = top.change;
        long long t = top.time;
        // cout << v << " " << c << " " << t << " " << q.size() << endl;
        if(c < 0 or dp[v][c] <= t) continue;
        dp[v][c] = t;
        q.emplace(v, min(c+C[v], mx), t+D[v]);
        for(auto e: G[v]){
            q.emplace(e.to, min(c-e.change, mx), t+e.time);
        }
    }

    FOR(i, 1, N) cout << *min_element(dp[i].begin(), dp[i].end()) << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:24: error: template argument 1 is invalid
   52 |     priority_queue<data> q;
      |                        ^
a.cc:52:24: error: template argument 2 is invalid
a.cc:52:24: error: template argument 3 is invalid
a.cc:53:7: error: request for member 'emplace' in 'q', which is of non-class type 'int'
   53 |     q.emplace(0, min(S, mx), 0);
      |       ^~~~~~~
a.cc:54:14: error: request for member 'empty' in 'q', which is of non-class type 'int'
   54 |     while(!q.empty()){
      |              ^~~~~
a.cc:55:22: error: request for member 'top' in 'q', which is of non-class type 'int'
   55 |         auto top = q.top(); q.pop();
      |                      ^~~
a.cc:55:31: error: request for member 'pop' in 'q', which is of non-class type 'int'
   55 |         auto top = q.top(); q.pop();
      |                               ^~~
a.cc:62:11: error: request for member 'emplace' in 'q', which is of non-class type 'int'
   62 |         q.emplace(v, min(c+C[v], mx), t+D[v]);
      |           ^~~~~~~
a.cc:64:15: error: request for member 'emplace' in 'q', which is of non-class type 'int'
   64 |             q.emplace(e.to, min(c-e.change, mx), t+e.time);
      |               ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

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

struct Edge{
  int to,a,b;
  Edge(int to, int a, int b):to(to),a(a),b(b) {}
};

struct Data {
  int v, s;
  ll x;
  Data(int v, int s, ll x):v(v),s(s),x(x) {}
  bool operator<(const Data& a) const {
    return x > a.x;
  }
};

vector<Edge> g[MAX_V];
ll dp[MAX_V][MAX_S+5];


int 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].emplace_back(v,a,b);
    g[v].emplace_back(u,a,b);
  }
  rep(i,MAX_V)rep(j,MAX_S+S)dp[i][j] =INF;//dpの初期化
  s=min(s,MAX_S);

  priority_queue<Data> q;
  auto push =[&](int v,int s, ll x){
    if (s<0) return ;
    if (dp[v][s]<=x) return;
    dp[v][s]=x;
    q.emplace(v,s,x);
  };

  push(0,s,0);
  while (!q.empty()){
    Data hoge =q.top(); q.pop();
    int v=hoge.v, s=hoge.s;
    ll x =hoge.x;
    if(dp[v][s]>x) continue;
    {
      int ns=min(s+c[v],MAX_S);
      push(v,ns,x+d[v]);
    }
    for(Edge e :g[v]){
      push(e.to,s-e.a,x+e.b);
    }
  }
  for (int i=1;i<n;++i){
    ll ans =INF;
    rep(j,MAX_S+5){
      ans =min(ans,dp[i][j]);
    }
    cout <<ans<<endl;
  }
  


}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:27: error: 'S' was not declared in this scope
   39 |   rep(i,MAX_V)rep(j,MAX_S+S)dp[i][j] =INF;//dpの初期化
      |                           ^
a.cc:2:39: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i = 0; i < (n); ++i)
      |                                       ^
a.cc:57:20: error: 'c' was not declared in this scope
   57 |       int ns=min(s+c[v],MAX_S);
      |                    ^
a.cc:58:19: error: 'd' was not declared in this scope
   58 |       push(v,ns,x+d[v]);
      |                   ^
Language: C

#include<stdio.h>
#define l long
#define ll long long
#define INF 50000000000
#define new 1
#define used 0
#define min(x,y) x>y?y:x

typedef struct dist {
    int ume;
    int citynum[2600];
    ll cost[2600];
}DIST;

int N, M, S, U, V, A;
l B, C, D;
DIST dist[50*2500];
ll city[50 * 2500];
int mark[50 * 2500];

int setting();

int input();

ll dikstr(int goal);

int main() {

    input();

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

        setting();

        printf("%lld\n", dikstr(i));

    };

};

int setting() {
    for (int i = 0; i < 50 * 2500; i++) {
        city[i] = INF;
        mark[i] = new;
    };
    city[S] = 0;
};

int input() {
    scanf_s("%d%d%d", &N, &M, &S);
    for (int i = 0; i < 50 * 2500; i++)dist[i].ume = 0;
    for (int i = 0; i < M; i++){
        scanf_s("%d%d%d%ld", &U, &V, &A, &B); U--; V--;
        for (int j = A; j < 2500; j++) {
            dist[U * 2500 + j].citynum[++dist[U * 2500 + j].ume ] = V * 2500 + j - A;
            dist[U * 2500 + j].cost[dist[U * 2500 + j].ume] = B;
            dist[V * 2500 + j].citynum[++dist[V * 2500 + j].ume ] = U * 2500 + j - A;
            dist[V * 2500 + j].cost[dist[V * 2500 + j].ume] = B;
        };
    };
    for (int i = 0; i < N; i++) {
        scanf_s("%ld%ld", &C, &D);
        for (int j = 0; j < 2498; j++) {
            dist[i * 2500 + j].citynum[++dist[i * 2500 + j].ume]=i * 2500 + min(j + C, 2499);
            dist[i * 2500 + j].cost[dist[i * 2500 + j].ume] = D;
        };
    };
};

ll dikstr(int goal) {
    ll mint;
    int present;
    while (1) {
        mint = INF;
        for (int i = 0; i < N * 2500; i++) {
            if (mark[i] && mint > city[i]) {
                mint = city[i];
                present = i;
                mark[i] = used;
            };
        };
        if (present >= goal * 2500 && present < (goal + 1) * 2500)
            return city[present];
        for (int i = 0; i <= dist[present].ume; i++) {
            if (city[dist[present].citynum[i] ]> city[present] + dist[present].citynum[i]) {
                city[dist[present].citynum[i]] = city[present] + dist[present].citynum[i];
            };
        };
    };
};


Compiler output:
main.c: In function 'input':
main.c:50:5: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   50 |     scanf_s("%d%d%d", &N, &M, &S);
      |     ^~~~~~~
      |     scanf
Language: C

#include<stdio.h>
#define l long
#define ll long long
#define INF 100000000000
#define new 1
#define used 0
#define min(x,y) x>y?y:x

typedef struct dist {
    int ume;
    int citynum[2600];
    l cost[2600];
}DIST;

int N, M, S, U, V, A;
l B, C, D;
DIST dist[50*2500];
ll city[50 * 2500];
int mark[50 * 2500];

int setting();

int input();

ll dikstr(int goal);

int main() {

    input();

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

        setting();

        printf("%lld\n", dikstr(i));

    };

};

int setting() {
    for (int i = 0; i < 50 * 2500; i++) {
        city[i] = INF;
        mark[i] = new;
        for (int j = 0; j <= dist[i].ume; j++) {
            dist[i].citynum[j]= INF;
        };
    };
    city[S] = 0;
};

int input() {
    scanf_s("%d%d%d", &N, &M, &S);
    for (int i = 0; i < 50 * 2500; i++)dist[i].ume = 0;
    for (int i = 0; i < M; i++){
        scanf_s("%d%d%d%ld", &U, &V, &A, &B); U--; V--;
        for (int j = A; j < 2500; j++) {
            dist[U * 2500 + j].citynum[++dist[U * 2500 + j].ume ] = V * 2500 + j - A;
            dist[U * 2500 + j].cost[dist[U * 2500 + j].ume] = B;
            dist[V * 2500 + j].citynum[++dist[V * 2500 + j].ume ] = U * 2500 + j - A;
            dist[V * 2500 + j].cost[dist[V * 2500 + j].ume] = B;
        };
    };
    for (int i = 0; i < N; i++) {
        scanf_s("%ld%ld", &C, &D);
        for (int j = 0; j < 2498; j++) {
            dist[i * 2500 + j].citynum[++dist[i * 2500 + j].ume]=i * 2500 + min(j + C, 2499);
            dist[i * 2500 + j].cost[dist[i * 2500 + j].ume] = D;
        };
    };
};

ll dikstr(int goal) {
    ll mint;
    int present;
    while (1) {
        mint = INF;
        for (int i = 0; i < N * 2500; i++) {
            if (mark[i] && mint > city[i]) {
                mint = city[i];
                present = i;
                mark[i] = used;
            };
        };
        if (present >= goal * 2500 && present < (goal + 1) * 2500)
            return city[present];
        for (int i = 0; i <= dist[present].ume; i++) {
            if (city[dist[present].citynum[i] ]> city[present] + dist[present].citynum[i]) {
                city[dist[present].citynum[i]] = city[present] + dist[present].citynum[i];
            };
        };
    };
};

Compiler output:
main.c: In function 'setting':
main.c:4:13: warning: overflow in conversion from 'long int' to 'int' changes value from '100000000000' to '1215752192' [-Woverflow]
    4 | #define INF 100000000000
      |             ^~~~~~~~~~~~
main.c:46:33: note: in expansion of macro 'INF'
   46 |             dist[i].citynum[j]= INF;
      |                                 ^~~
main.c: In function 'input':
main.c:53:5: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   53 |     scanf_s("%d%d%d", &N, &M, &S);
      |     ^~~~~~~
      |     scanf
Language: C++

#include<bits/stdc++.h>
//using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define rep(i,j,n) for(ll i=(ll)(j);i<(ll)(n);i++)
#define REP(i,j,n) for(ll i=(ll)(j);i<=(ll)(n);i++)
#define per(i,j,n) for(ll i=(ll)(j);(ll)(n)<=i;i--)
#define ll int
#define ALL(a) (a).begin(),(a).end()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(ll)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(ll)(key)))
#define pb push_back
#define mp std::make_pair
#define endl "\n"
using std::cin;
using std::cout;
using std::vector;
using std::string;
using std::upper_bound;
using std::lower_bound;
using vi=vector<ll>;
using vii=vector<vi>;
using pii=std::pair<ll,ll>;
const ll MOD=1e9+7;
//const ll MOD=998244353;
//const ll MOD=100000;
const ll MAX=1e7;
const ll INF=(1ll<<30);
template<class T>
class prique :public std::priority_queue<T, std::vector<T>, std::greater<T>> {};
ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
signed main(){
    ll N,M,S; cin>>N>>M>>S;
    const ll max=2500;
    vector<vector<std::pair<ll,pii>>> edge(N);
    rep(i,0,M){
        ll A,B,C,D; cin>>A>>B>>C>>D;
        edge[A-1].pb(mp(B-1,mp(C,D)));
        edge[B-1].pb(mp(A-1,mp(C,D)));
    }
    vi C(N),T(N);
    rep(i,0,N) cin>>C[i]>>T[i];
    vector<vii> dp(N,vii(N,vi(max+1,INF)));
    dp[0][0][0]=0;
    vi ans(N,INF);
    prique<std::pair<pii,pii>> que;
    que.push(mp(mp(0,0),mp(0,0)));
    while(!que.empty()){
        ll X=que.top().second.first,Y=que.top().second.second,A=que.top().first.first,B=que.top().first.second;
        que.pop();
        ll x=std::max(0,B-S);
        ans[X]=std::min(ans[X],(x+C[Y]-1)/C[Y]*T[Y]+A);
        if(dp[X][Y][B]<A) continue;
        rep(i,0,edge[X].size()){
            ll Z=edge[X][i].first,coin=edge[X][i].second.first+B,time=edge[X][i].second.second+A;
            if(coin>max){
                continue;
            }
            if(dp[Z][Y][coin]>time){
                dp[Z][Y][coin]=time;
                que.push(mp(mp(time,coin),mp(Z,Y)));
            }
        }
        if(B>S){
            A+=(B-S+C[Y]-1)/C[Y]*T[Y];
            B=S;
        }
        Y=X;
        if(dp[X][Y][B]<=A) continue;
        dp[X][Y][B]=A;
        rep(i,0,edge[X].size()){
            ll Z=edge[X][i].first,coin=edge[X][i].second.first+B,time=edge[X][i].second.second+A;
            if(coin>max){
                continue;
            }
            if(dp[Z][Y][coin]>time){
                dp[Z][Y][coin]=time;
                que.push(mp(mp(time,coin),mp(Z,Y)));
            }
        }
    }
    rep(i,1,N) cout<<ans[i]<<endl;
}


Compiler output:
a.cc:32:1: error: 'ios' does not name a type
   32 | ios::sync_with_stdio(false);
      | ^~~
a.cc:33:10: error: 'cin' in namespace 'std' does not name a type
   33 |     std::cin.tie(nullptr);
      |          ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#include<bits/stdc++.h>
//using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define rep(i,j,n) for(ll i=(ll)(j);i<(ll)(n);i++)
#define REP(i,j,n) for(ll i=(ll)(j);i<=(ll)(n);i++)
#define per(i,j,n) for(ll i=(ll)(j);(ll)(n)<=i;i--)
#define ll int
#define ALL(a) (a).begin(),(a).end()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(ll)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(ll)(key)))
#define pb push_back
#define mp std::make_pair
#define endl "\n"
using std::cin;
using std::cout;
using std::vector;
using std::string;
using std::upper_bound;
using std::lower_bound;
using vi=vector<ll>;
using vii=vector<vi>;
using pii=std::pair<ll,ll>;
const ll MOD=1e9+7;
//const ll MOD=998244353;
//const ll MOD=100000;
const ll MAX=1e7;
const ll INF=(1ll<<30);
template<class T>
class prique :public std::priority_queue<T, std::vector<T>, std::greater<T>> {};
signed main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    ll N,M,S; cin>>N>>M>>S;
    const ll max=2500;
    vector<vector<std::pair<ll,pii>>> edge(N);
    rep(i,0,M){
        ll A,B,C,D; cin>>A>>B>>C>>D;
        edge[A-1].pb(mp(B-1,mp(C,D)));
        edge[B-1].pb(mp(A-1,mp(C,D)));
    }
    vi C(N),T(N);
    rep(i,0,N) cin>>C[i]>>T[i];
    vector<vii> dp(N,vii(N,vi(max+1,INF)));
    dp[0][0][0]=0;
    vi ans(N,INF);
    prique<std::pair<pii,pii>> que;
    que.push(mp(mp(0,0),mp(0,0)));
    while(!que.empty()){
        ll X=que.top().second.first,Y=que.top().second.second,A=que.top().first.first,B=que.top().first.second;
        que.pop();
        ll x=std::max(0,B-S);
        ans[X]=std::min(ans[X],(x+C[Y]-1)/C[Y]*T[Y]+A);
        if(dp[X][Y][B]<A) continue;
        rep(i,0,edge[X].size()){
            ll Z=edge[X][i].first,coin=edge[X][i].second.first+B,time=edge[X][i].second.second+A;
            if(coin>max){
                continue;
            }
            if(dp[Z][Y][coin]>time){
                dp[Z][Y][coin]=time;
                que.push(mp(mp(time,coin),mp(Z,Y)));
            }
        }
        if(B>S){
            A+=(B-S+C[Y]-1)/C[Y]*T[Y];
            B=S;
        }
        Y=X;
        if(dp[X][Y][B]<=A) continue;
        dp[X][Y][B]=A;
        rep(i,0,edge[X].size()){
            ll Z=edge[X][i].first,coin=edge[X][i].second.first+B,time=edge[X][i].second.second+A;
            if(coin>max){
                continue;
            }
            if(dp[Z][Y][coin]>time){
                dp[Z][Y][coin]=time;
                que.push(mp(mp(time,coin),mp(Z,Y)));
            }
        }
    }
    rep(i,1,N) cout<<ans[i]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:5: error: 'ios' has not been declared
   33 |     ios::sync_with_stdio(false);
      |     ^~~
Language: C++

#include<bits/stdc++.h>
//using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define rep(i,j,n) for(ll i=(ll)(j);i<(ll)(n);i++)
#define REP(i,j,n) for(ll i=(ll)(j);i<=(ll)(n);i++)
#define per(i,j,n) for(ll i=(ll)(j);(ll)(n)<=i;i--)
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(ll)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(ll)(key)))
#define pb push_back
#define mp std::make_pair
#define endl "\n"
using std::cin;
using std::cout;
using std::vector;
using std::string;
using std::upper_bound;
using std::lower_bound;
using vi=vector<ll>;
using vii=vector<vi>;
using pii=std::pair<ll,ll>;
const ll MOD=1e9+7;
//const ll MOD=998244353;
//const ll MOD=100000;
const ll MAX=1e7;
const ll INF=(1ll<<60);
template<class T>
class prique :public std::priority_queue<T, std::vector<T>, std::greater<T>> {};
signed main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    ll N,M,S; scanf("%lld %lld %lld\n",&N,&M,&S);
    const ll max=2500;
    vector<vector<std::pair<ll,pii>>> edge(N);
    rep(i,0,M){
        ll A,B,C,D; scanf("%lld %lld %lld %lld\n",&A,&B,&C,&D);
        edge[A-1].pb(mp(B-1,mp(C,D)));
        edge[B-1].pb(mp(A-1,mp(C,D)));
    }
    vi C(N),T(N);
    rep(i,0,N) cin>>C[i]>>T[i];
    vector<vii> dp(N,vii(N,vi(max+1,INF)));
    dp[0][0][0]=0;
    vi ans(N,INF);
    prique<std::pair<pii,pii>> que;
    que.push(mp(mp(0,0),mp(0,0)));
    while(!que.empty()){
        ll X=que.top().second.first,Y=que.top().second.second,A=que.top().first.first,B=que.top().first.second;
        que.pop();
        ll x=std::max(0ll,B-S);
        ans[X]=std::min(ans[X],(x+C[Y]-1)/C[Y]*T[Y]+A);
        if(dp[X][Y][B]<A) continue;
        rep(i,0,edge[X].size()){
            ll Z=edge[X][i].first,coin=edge[X][i].second.first+B,time=edge[X][i].second.second+A;
            if(coin>max){
                continue;
            }
            if(dp[Z][Y][coin]>time){
                dp[Z][Y][coin]=time;
                que.push(mp(mp(time,coin),mp(Z,Y)));
            }
        }
        if(B>S){
            A+=(B-S+C[Y]-1)/C[Y]*T[Y];
            B=S;
        }
        Y=X;
        if(dp[X][Y][B]<=A) continue;
        dp[X][Y][B]=A;
        rep(i,0,edge[X].size()){
            ll Z=edge[X][i].first,coin=edge[X][i].second.first+B,time=edge[X][i].second.second+A;
            if(coin>max){
                continue;
            }
            if(dp[Z][Y][coin]>time){
                dp[Z][Y][coin]=time;
                que.push(mp(mp(time,coin),mp(Z,Y)));
            }
        }
    }
    rep(i,1,N) cout<<ans[i]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:5: error: 'ios' has not been declared
   33 |     ios::sync_with_stdio(false);
      |     ^~~