Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cout << #x << " = " << (x) << endl;
using Graph = vector<vector<int> >;
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; }
#define int long long

int n, m;
ll l;
struct edge{int to; ll c;};
vector<edge> G[330];

void solve() {
	cin >> n >> m >> l;
    rep(i, m) {
        int a, b; ll c;
        cin >> a >> b >> c;
        --a; --b;
        G[a].push_back(edge{b, c});
        G[b].push_back(edge{a, c});
    }
    int mini[330][330];
    rep(i, n) {
        rep(j, n) {
            mini[i][j] = INF;
        }
    }
    queue<tuple<int, ll, int>> que;
    rep(i, n) {
        if(se.count(i)) continue;
        que.push(make_tuple(i, l, 0)));
        mini[i][i] = 0;
        while(que.size()) {
            tuple<int , ll, int> p = que.front(); que.pop();
            int v = tuple<0>(p);
            ll f = tuple<1>(p; int cnt = tuple<2>(p;
            for(auto nv: G[v]) {
                int to = nv.to; ll c = nv.c;
                int res; ll fu;
                if(c > f) {
                    res = cnt + 1;
                    fu = l - c;
                    se.insert(v);
                    mp[v] = i;
                    if(fu < 0) continue;
                } else {
                    res = cnt;
                    fu = f - c;
                }
                if(res <= mini[i][to]) {
                    que.push(make_tuple(to, fu, res));
                    mini[i][to] = res;
                }
            }

        }
    }

    int q; cin >> q;
    rep(i, q) {
        int s, t; cin >> s >> t;
        --s; --t;
        if(mini[s][t] == INF) {
            cout << -1 << endl;
        }else {
            cout << mini[s][t] << endl;
        }
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:74:12: error: 'se' was not declared in this scope; did you mean 'sc'?
   74 |         if(se.count(i)) continue;
      |            ^~
      |            sc
a.cc:75:38: error: expected ';' before ')' token
   75 |         que.push(make_tuple(i, l, 0)));
      |                                      ^
      |                                      ;
a.cc:79:28: error: type/value mismatch at argument 1 in template parameter list for 'template<class ...> class std::tuple'
   79 |             int v = tuple<0>(p);
      |                            ^
a.cc:79:28: note:   expected a type, got '0'
a.cc:80:27: error: type/value mismatch at argument 1 in template parameter list for 'template<class ...> class std::tuple'
   80 |             ll f = tuple<1>(p; int cnt = tuple<2>(p;
      |                           ^
a.cc:80:27: note:   expected a type, got '1'
a.cc:80:30: error: expected ')' before ';' token
   80 |             ll f = tuple<1>(p; int cnt = tuple<2>(p;
      |                            ~ ^
      |                              )
a.cc:80:49: error: type/value mismatch at argument 1 in template parameter list for 'template<class ...> class std::tuple'
   80 |             ll f = tuple<1>(p; int cnt = tuple<2>(p;
      |                                                 ^
a.cc:80:49: note:   expected a type, got '2'
a.cc:80:52: error: expected ')' before ';' token
   80 |             ll f = tuple<1>(p; int cnt = tuple<2>(p;
      |                                                  ~ ^
      |                                                    )
a.cc:87:21: error: 'se' was not declared in this scope; did you mean 'sc'?
   87 |                     se.insert(v);
      |                     ^~
      |                     sc
a.cc:88:21: error: 'mp' was not declared in this scope; did you mean 'p'?
   88 |                     mp[v] = i;
      |                     ^~
      |                     p