Language: C++

#include<bits/stdc++.h>
#define pi 3.1415  
#define ll long long
#define pii pair<ll,ll>
#define debug(a) cout<<a<<'\n'
#define maxn 309
#define MOD 1000000007
#define INF (int)3000009
using namespace std;
ll n,m,l;
vector<pii> adj[maxn];
ll dist[maxn];
pii parent[maxn];
void INFINITAR(){
    for(int i=1;i<=n;i++){
        dist[i]=1e13+9;
    }
}
void addedge(ll a,ll b, ll c){
    adj[a].push_back(b,c);
    adj[b].push_back(a,c);
}
void djikstra(ll x){
    INFINITAR();
    for(int i=1;i<=n;i++){
        parent[i]={-1,-1};
    }
    dist[x]=0;
    priority_queue<pii,vector<pii>,greater<pii> > pq;
    pq.push({0,x});
    while(!pq.empty()){
        auto f=pq.top();
        pq.pop();
        if(dist[f.second]<f.first)continue;
        for(auto e:adj[f.second]){
            if(f.first+e.second<dist[e.first]){
                dist[e.first]=f.first+e.second;
                pq.push({dist[e.first],e.first});
                parent[e.first]={f.second,e.second};
            }
        }
    }
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>m>>l;
    for(int i=0;i<m;i++){
        ll a,b,c;
        cin>>a>>b>>c;
        if(c>=l)continue;
        addedge(a,b,c);
    }
    int q;
    cin>>q;
    while(q--){
        ll ans=0;
        ll a,b;
        cin>>a>>b;
        djikstra(a);
        if(dist[b]==1e13+9)cout<<-1<<'\n';
        else{
            ll act=b;
            ll actc=l;
            while(act!=a){
                if(parent[act].second>=actc){
                    ans++;
                    actc=l-parent[act].second;
                    act=parent[act].first;
                }
                else{
                    actc-=parent[act].second;
                    act=parent[act].first;
                }
            }
            cout<<ans<<'\n';
        }
    }
    return 0;
}   

Compiler output:
a.cc: In function 'void addedge(long long int, long long int, long long int)':
a.cc:20:21: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(long long int&, long long int&)'
   20 |     adj[a].push_back(b,c);
      |     ~~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
a.cc:21:21: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(long long int&, long long int&)'
   21 |     adj[b].push_back(a,c);
      |     ~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided