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

#include <bits/stdc++.h>
#define ll long long
#define PB push_back
#define MP make_pair

#define REP(i, n) for(int i=0;i<(int)(n);++i)
#define FOR(i,l,h) for(int i=(int)(l);i<=(int)(h);++i)
#define FORD(i,h,l) for(int i=(int)(h);i>=(int)(l);--i)

#define max(a,b) a>b?a:b
#define min(a,b) a>b?b:a

ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }

#define dump(x)  cerr << #x << " = " << (x) << endl
#define ALL(t) (t).begin(),(t).end()

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n>>m>>l;
    ll int gr[n+2][n+2];

    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            gr[i][j] = INF;
        }
        //cout<<"\n";
    }
    //memset(gr , INF , sizeof(gr));
    /*cout<<"graph is Before: \n";
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cout<<gr[i][j]<<" ";
        }
        cout<<"\n";
    }*/
    for(int i=0;i<m;i++){
        int a,b,c;cin>>a>>b>>c;
        a--;b--;
        gr[a][b] = c;
        gr[b][a] = c;

    }
    //
    for(int k =0;k<n;k++){
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                if(gr[i][j] > gr[i][k] + gr[k][j])
                        gr[i][j] = gr[i][k] + gr[k][j];
            }
        }
    }
    //dump(INF);
    /*
    cout<<"graph is after: \n";
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cout<<gr[i][j]<<" ";
        }
        cout<<"\n";
    } */
    //
    //floyd_warshall(gr);
    int t;cin>>t;
    while (t--) {
        int s1,t1;cin>>s1>>t1;
        s1--;t1--;
        if(gr[s1][t1] == INF){
            cout<<"-1\n";
        }
        else{
            ll int ans = ceil(gr[s1][t1]/(double)l) - 1 ;
            if(ans<0)cout<<"0\n";
            else
                  cout<<ans<<"\n";
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   24 |     cin>>n>>m>>l;
      |          ^
      |          yn
a.cc:24:13: error: 'm' was not declared in this scope; did you mean 'tm'?
   24 |     cin>>n>>m>>l;
      |             ^
      |             tm
a.cc:24:16: error: 'l' was not declared in this scope; did you mean 'll'?
   24 |     cin>>n>>m>>l;
      |                ^
      |                ll
a.cc:29:13: error: 'gr' was not declared in this scope
   29 |             gr[i][j] = INF;
      |             ^~
a.cc:29:24: error: 'INF' was not declared in this scope
   29 |             gr[i][j] = INF;
      |                        ^~~
a.cc:44:9: error: 'gr' was not declared in this scope
   44 |         gr[a][b] = c;
      |         ^~
a.cc:52:20: error: 'gr' was not declared in this scope
   52 |                 if(gr[i][j] > gr[i][k] + gr[k][j])
      |                    ^~
a.cc:72:12: error: 'gr' was not declared in this scope
   72 |         if(gr[s1][t1] == INF){
      |            ^~
a.cc:72:26: error: 'INF' was not declared in this scope
   72 |         if(gr[s1][t1] == INF){
      |                          ^~~
Language: Java

// https://atcoder.jp/contests/abc143/tasks/abc143_e
import EdgeWeightedGraph.EdgeWeightedGraph;

import java.io.PrintWriter;
import java.util.Arrays;
import java.util.List;

public class TravelByCar {
  static FastReader fr = new FastReader();

  public static void main(String [] args) {
    int N = fr.nextInt();
    int M = fr.nextInt();
    int L = fr.nextInt();

    final long INF = 1L << 60;
    long [][] G = new long[N][N];
    int [][] dist = new int[N][N];
    for (int i = 0; i < N; i++) {
      Arrays.fill(G[i], INF);
      Arrays.fill(dist[i], 9999);
      G[i][i] = 0;
      dist[i][i] = 0;
    }

    for (int i = 0; i < M; i++) {
      int A = fr.nextInt() - 1;
      int B = fr.nextInt() - 1;
      int C = fr.nextInt();

      G[A][B] = G[B][A] = C;
    }

    for (int k = 0; k < N; k++) {
      for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
          if (G[i][k] + G[k][j] < G[i][j])
            G[i][j] = G[i][k] + G[k][j];
        }
      }
    }

    for (int i = 0; i < N; i++) {
      for (int j = i + 1; j < N; j++) {
        if (G[i][j] <= L) {
          dist[i][j] = dist[j][i] = 1;
        }
      }
    }

    for (int k = 0; k < N; k++) {
      for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
          if (dist[i][k] + dist[k][j] < dist[i][j])
            dist[i][j] = dist[i][k] + dist[k][j];
        }
      }
    }

    int Q = fr.nextInt();
    PrintWriter writer = new PrintWriter(System.out);
    for (int i = 0; i < Q; i++) {
      int S = fr.nextInt() - 1;
      int T = fr.nextInt() - 1;
      writer.println(dist[S][T] > 999 ? -1 : dist[S][T] - 1);
    }
    writer.flush();
  }
}


Compiler output:
Main.java:8: error: class TravelByCar is public, should be declared in a file named TravelByCar.java
public class TravelByCar {
       ^
Main.java:2: error: package EdgeWeightedGraph does not exist
import EdgeWeightedGraph.EdgeWeightedGraph;
                        ^
Main.java:9: error: cannot find symbol
  static FastReader fr = new FastReader();
         ^
  symbol:   class FastReader
  location: class TravelByCar
Main.java:9: error: cannot find symbol
  static FastReader fr = new FastReader();
                             ^
  symbol:   class FastReader
  location: class TravelByCar
4 errors
Language: C++

#include<bits/stdc++.h>
#define N 310
int n,m,l,q,u,v,w,s,t,ga[N][N];
using namespace std;
int main()
{
	cin>>n>>m>>l;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			ga[i][j]=1e9;
		}
	}
	for(int i=1;i<=m;i++)
	{
		cin>>u>>v>>w;
		ga[u][v]=w;
		ga[v][u]=w;
		dist[u][v]=1;
		dist[v][u]=1;
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			for(int k=1;k<=n;k++)
			{
				if(i==j||i==k||j==k)
				{
					continue;
				}
				if(ga[i][k]+ga[k][j]<=ga[i][j])
				{
					ga[i][j]=ga[i][k]+ga[k][j];
				}
			}
		}
	}
	cin>>q;
	for(int i=1;i<=q;i++)
	{
		cin>>s>>t;
		if(ga[s][t]==1e9)
		{
			cout<<-1<<endl;
			continue;
		}
		cout<<ga[s][t]/l<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'dist' was not declared in this scope
   20 |                 dist[u][v]=1;
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
const int maxn = 305;
int n, m, l;
long long path[maxn][maxn];
int ans[maxn][maxn];
int main()
{
    scanf("%d%d%d", &n,&m, &l);
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++)
            path[i][j] = 1LLe17+7;
    }
    for(int i=1;i<=m;i++)
    {
        int x, y, v;
        scanf("%d%d%d",&x,&y, &v);
        path[x][y] = path[y][x] = v;
    }
    for(int i=1;i<=n;i++)
        path[i][i] = 0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            for(int k=1;k<=n;k++){
                path[i][j] = min(path[i][k] + path[k][j], path[i][j]);
            }
        }
    }
//    for(int i=1;i<=n;i++){
//        for(int j=1;j<=n;j++){
//            printf("%d %d %d\n",i, j, path[i][j]);
//        }
//    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            ans[i][j] = (path[i][j] <=l?1:1e9);
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            for(int k=1;k<=n;k++){
                ans[i][j] = min(ans[i][j], ans[i][k] + ans[k][j]);
            }
        }
    }
    int q;
    scanf("%d",&q);
    while(q--){
        int x, y;
        scanf("%d%d", &x, &y);
        printf("%d\n", ans[x][y]<=n?ans[x][y] - 1:-1);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: unable to find numeric literal operator 'operator""LLe17'
   13 |             path[i][j] = 1LLe17+7;
      |                          ^~~~~~
Language: C++

#include<bits/stdc++.h>
 
#define REP(i,s,N) for (int i=s;i<(N); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;
#define INF 1e+10

ll ans=0;

int main(){
	ll N, M, L;
	cin >> N >> M >> L;
	ll A[M], B[M], C[M];
	REP(i,0,M) cin >> A[i] >> B[i] >> C[i];
	ll Q;
	cin >> Q;
	ll s[Q], t[Q];
	REP(i,0,Q) cin >> s[i] >> t[i];
	
	ll fuel[N][N];
	ll dist[N][N];
	
	REP(i,0,N){
	REP(j,0,N){
		if(i!=j){
			fuel[i][j] = INF;
			dist[i][j] = INF;
		}else{
			fuel[i][j] = 0;
			dist[i][j] = 0;
	}
	}
	
	REP(i,0,M){
		fuel[A[i]][B[i]] = min(fuel[A[i]][B[i]],C[i]);
	}
	
	REP(i,0,N){
	REP(j,0,N){
	REP(k,0,N){
		fuel[i][j] = min(fuel[i][j],fuel[i][k]+fuel[k][j]);
	}}}
	
	REP(i,0,N){
	REP(j,0,N){
	if(fuel[i][j] <= L) dist[i][j] = 1; 
	}}
	
	REP(i,0,N){
	REP(j,0,N){
	REP(k,0,N){
		dist[i][j] = min(dist[i][j],dist[i][k]+dist[k][j]);
	}}}
	
	REP(i,0,Q){
		if(dist[s[i]][t[i]] < INF){
			ans = dist[s[i]][t[i]]-1;
		}else{
			ans = -1;
		}
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:2: error: expected '}' at end of input
   65 | }
      |  ^
a.cc:11:11: note: to match this '{'
   11 | int main(){
      |           ^
Language: C++

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

long long go(vector<long long> &A, vector<long long> &B, vector<long long> &C, long long s, long long &t, long long M, long long &L, long long Lmax, long long &cnt){
    for(long long i=0; i<M; i++){
        if(B.at(i) == t){
            if(A.at(i) == s){
                if(C.at(i) <= L){
                    return cnt;
                }
                else{
                    if(C.at(i) <= Lmax){
                        cnt++;
                        return cnt;
                    }
                    else{
                        cnt = -1;
                        return cnt;
                    }
                }
            }
            else{
//                cout << "L1 = "<< L << " cnt1 = " << cnt << " C = " << C.at(i) << endl;
                L = L - C.at(i);
                if(L <= 0){
                    L = Lmax - C.at(i);
                    cnt++;
                }
//                cout << "L2 = "<< L << " cnt2 = " << cnt << endl;                
                long long tmp = go(A, B, C, s, A.at(i), M, L, Lmax, cnt);
            }
        }
    }

    return cnt;
}

long long main() {
    long long N, M = 0;
    long long L = 0;
    cin >> N >> M >> L;

    vector<long long> A(M, 0);
    vector<long long> B(M, 0);
    vector<long long> C(M, 0);
    for(long long i=0; i<M; i++){
        cin >> A.at(i) >> B.at(i) >> C.at(i);
    }

    long long Q=0;
    cin >> Q;

    vector<long long> s(Q, 0);
    vector<long long> t(Q, 0);

    long long a=0;
    for(long long i=0; i<Q; i++){
        cin >> s.at(i) >> t.at(i);
        if(s.at(i) > t.at(i)){
            a = s.at(i);
            s.at(i) = t.at(i);
            t.at(i) = a; 
        }
    }

    if(M == 0){
        cout << "-1" << endl;
        return 0;
    }

    long long cnt=0;
    long long Lmax = L;
    for(long long i=0; i<Q; i++){
        long long tmp = go(A, B, C, s.at(i), t.at(i), M, L, Lmax, cnt);
        cnt = 0;
        L = Lmax;
        cout << tmp << endl;
    }

}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

// ~maqsat~

// #pragma GCC target ("avx2")
// #pragma GCC optimization ("Ofast")
// #pragma GCC optimization ("unroll-loops")

// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define F first
#define S second
#define in insert
#define pb push_back
#define eb emplace_back
#define sz(x) int(x.size())
#define all(x) x.begin(), x.end()
#define count1 __builtin_popcountl
#define debug(x) cerr << (#x) << " = " << (x) << "\n"
#define ACCELERATE ios_base::sync_with_stdio(false),cin.tie(nullptr)
#define fre(f) if(fopen(f".in", "r")) freopen(f".in", "r", stdin),freopen(f".out", "w", stdout)

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using ull = unsigned long long;
// using big = __int128_t; // -10^38...10^38
using db = double;
using ld = long double;
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;

template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T> inline void cmin(T &a, T b) { a = min(a, b); }
template <class T> inline void cmax(T &a, T b) { a = max(a, b); }

const int oo = 0x3f3f3f3f;
const ll N = 1e5 + 345;
const ll MOD = 1e9 + 7;
const ll INF = 1e18 + 9;
const db EPS = 1e-9;
const db PI = acos(-1); // 3.14159265358979323846
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};

ll dp[350][350], ans[350][350];

#define int ll

main() {
    fre("");
    ACCELERATE;
    
    int n, m, l;
    cin >> n >> m >> l;

    for(int i = 0; i <= 300; i++)
        for(int j = 0; j <= 300; j++)
            dp[i][j] = (i == j ? 0 : INF);

    for(int i = 0; i < m; i++) {
        int a, b;
        ll w;
        cin >> a >> b >> w;
        a--, b--;
        dp[a][b] = dp[b][a] = w;
    }
    
    for(int k = 0; k < n; k++)
        for(int i = 0; i < n; i++)
            for(int j = 0; j < n; j++)
                cmin(dp[i][j], dp[i][k] + dp[k][j]);

    ans = dp;
    for(int i = 0; i <= 300; i++) {
        for(int j = 0; j <= 300; j++) {
            ans[i][j] = (dp[i][j] <= l ? 1 : INF);
            if(i == j) ans[i][j] = 0;
        }
    }

    for(int k = 0; k < n; k++)
        for(int i = 0; i < n; i++)
            for(int j = 0; j < n; j++)
                cmin(ans[i][j], ans[i][k] + ans[k][j]);

    int q;
    cin >> q;
    while(q--) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        if(dp[a][b] >= INF) cout << "-1\n";
        else cout << ans[a][b] - 1 << '\n';
    }

    return 0;
}


Compiler output:
a.cc:55:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   55 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:79:9: error: invalid array assignment
   79 |     ans = dp;
      |     ~~~~^~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

//全点対最短路問題
int N;
void warshall_floyd(vector<vector<ll>> d;) {
    for(int k = 0; k < N; k++) {
        for(int i = 0; i < N; i++) {
            for(int j = 0; j < N; j++) {
                if(d[i][k] + d[k][j] < d[i][j]) {
                    d[i][j] = d[i][k] + d[k][j];
                }
            }
        }
    }
}

int main() {
    int M;
    ll L; // town, road, kutter
    cin >> N >> M >> L;
    // road i Ai to Bi length Ci
    vector<vector<ll>> edge(N, vector<ll>(N, INF));
    vector<vector<ll>> cnt(N, vector<ll>(N, INF));
    REP(i, N) {
        edge[i][i] = 0LL;
        cnt[i][i] = 0LL:
    }
    REP(i, M) {
        int a, b;
        ll c;
        cin >> a >> b >> c;
        a--;
        b--;
        if(c > L) {
            c = INF;
        }
        edge[a][b] = c;
        edge[b][a] = c;
    }
    warshall_floyd(edge);
    REP(i, N) {
        REP(j, N) {
            if(edge[i][j] < L) {
                cnt[i][j] = 1;
            }
        }
    }
    warshall_floyd(cnt);
    //最短経路
    ll Q;
    cin >> Q;
    // bellmanford で最短ろ求めてから経路復元
    vector<int> sq(Q), tq(Q);
    REP(i, Q) {
        int s, t;
        cin >> s >> t;
        s--;
        t--;
        cout << cnt[s][t] << endl;
    }
    return 0;
}


Compiler output:
a.cc:38:41: error: expected ')' before ';' token
   38 | void warshall_floyd(vector<vector<ll>> d;) {
      |                    ~                    ^
      |                                         )
a.cc:38:42: error: expected unqualified-id before ')' token
   38 | void warshall_floyd(vector<vector<ll>> d;) {
      |                                          ^
a.cc: In function 'int main()':
a.cc:59:24: error: expected ';' before ':' token
   59 |         cnt[i][i] = 0LL:
      |                        ^
      |                        ;
Language: C++

#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define DBG_N(hoge) cerr<<" "<<(hoge)<<endl;
#define DBG cerr<<"!"<<endl;
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;
typedef struct E{
  ll to,cost;
}edge;
const ll MAX_V=333;
const ll Inf=1e18;
vector<vector<edge>>E(MAX_V);
pair<ll,ll> d[MAX_V];
ll n,m,l;
void dijkstra(ll s){
  priority_queue<pair<pair<ll,ll>,ll>,vector<pair<pair<ll,ll>,ll>>,greater<>>que;
  fill_n(d,MAX_V,mp(Inf,-Inf));
  d[s] = mp(0,0);
  que.push(mp(mp(0,0),s));
  while(!que.empty()){
    pair<pair<ll,ll>,ll> p = que.top();
    que.pop();
    ll v = p.second;
    ll cnt=p.first.first;
    ll lit=p.first.second;
    if(d[v].first < p.first.first)continue;
    for(int j = 0;j < E[v].size();j++){
      edge t = E[v][j];
      ll cost=t.cost;
      ll cou=0;
      if(t.cost > lit){
	cou++;
	cost = l-lit;
      }
      if(cost<0)continue;
      if(d[t.to].first > cou + cnt){
	d[t.to].first = cou + cnt;
	d[t.to].second = -cost;
	que.push(mp(mp(cou+cnt,-cost),t.to));
      }else if(d[t.to].first == cou + cnt){
	if(d[t.to].second > -cost){
	d[t.to].first = cou + cnt;
	d[t.to].second = -cost;
	que.push(mp(mp(cou+cnt,-cost),t.to));
	}
      }
    }
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n>>m>>l;
  for(int i=0;i<m;i++){
    ll from,to,cost;
    cin>>from>>to>>cost;
    E[--from].pb({--to,cost});
    E[to].pb({from,cost});
  }
  ll q;cin>>q;
  for(int i=0;i<q;i++){
    ll from,to;
    cin>>from>>to;
    --from;--to;
    dijkstra(from);
    if(d[to.first] == Inf)cout<<-1<<endl;
    else
    cout<<d[to].first-1<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:80:13: error: request for member 'first' in 'to', which is of non-class type 'long long int'
   80 |     if(d[to.first] == Inf)cout<<-1<<endl;
      |             ^~~~~
Language: C++

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

#define int long long
using ll=long long;
using P=pair<int,int>;

const int MOD=1e9+7;
const int INF=1<<28;
const int MAX=1e5;

template<class T>
inline void xmin(T &a, T b){a=((a<b)?a:b);}
template<class T>
inline void xmax(T &a, T b){a=((a>b)?a:b);}

template<class T>
inline T vmin(T a, T b){return ((a<b)?a:b);}
template<class T>
inline T vmax(T a, T b){return ((a>b)?a:b);}

int n,m;
int l;
int G[305][305];
int H[305][305];
const int inf=1e17;

void solve(){
    cin>>n>>m>>l;
    int a,b,c;
    for(int i=0; i<305; i++){
        for(int j=0; j<305; j++){
            G[i][j]=inf;
            H[i][j]=inf;
        }
        G[i][i]=0;
        H[i][i]=0;
    }
    for(int i=0; i<m; i++){
        cin>>a>>b>>c;
        a--;b--;
        G[a][b]=c;
        G[b][a]=c;
    }
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            for(int k=0; k<n; k++){
                xmin(G[i][j],G[i][k]+G[k][j]);
            }
        }
    }

    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            if(l>=G[i][j]){
                H[i][j]=1LL;
            }
            else{
                H[i][j]=inf;
            }
        }
        H[i][i]==0;
    }

    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            for(int k=0; k<n; k++){
                xmin(H[i][j],H[i][k]+H[k][j]);
            }
        }
    }
    int q;
    cin>>q;
    int s,t;
    for(int i=0; i<q; i++){
        cin>>s>>t;
        s--;
        t--;
        if(H[s][t]==inf){
            cout<<-1<<endl;
        }
        else{
            cout<<H[s][t]-1<<endl;
        }
    }
   
    /*
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            if(H[i][j]==inf){
                cout<<-1<<" ";
            }
            else{
                cout<<H[i][j]<<" ";
            }
        }
       cout<<endl;
    }
    /*
    
}

signed main(){
    //while(1)
    solve();
}


Compiler output:
a.cc:87:5: error: unterminated comment
   87 |     /*
      |     ^
a.cc: In function 'void solve()':
a.cc:85:6: error: expected '}' at end of input
   85 |     }
      |      ^
a.cc:28:13: note: to match this '{'
   28 | void solve(){
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
class newdist{
public:
ll refills;
ll cur;

newdist(){};

bool operator < (const newdist b) const
{
	if(refills<b.refills)
		return 1;
	else if(refills == b.refills)
	{
		if(cur<b.cur)
			return 1;
		else
			return 0;
	}
	else
		return 0;

}

};

int main()
{
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
	
	ll n,m,cap,u,v,c;
	cin>>n>>m>>cap;
	vector<ll> edge[n+1];
	ll weight[n+1][n+1]={};
	newdist src[n+1][n+1], done[n+1]={};
	
	
	for(ll i=0 ; i<m ; i++)
	{
		cin>>u>>v>>c;
		if(c>cap)
			continue;
		edge[u].pb(v);
		edge[v].pb(u);
		weight[u][v] = c;
		weight[v][u] = c;
	}
	for(ll i = 1; i<=n ; i++)
	{
		for(ll j = 1; j<=n ; j++)
		{
			
			src[i][j].refills = 1e9;
			src[i][j].cur = 0;
		}
	}

	for(ll dij = 1; dij<=n ; dij++)
	{
		src[dij][dij].refills = 0;
		src[dij][dij].cur=cap;
		set <pair<newdist,ll>> prqueue;
		
		for(ll i=1; i<=n ; i++)
			{
				vis[i]=0;
				prqueue.insert(mp(src[dij][i],i));
			}
				

		while(!prqueue.empty())
		{
			pair<newdist,ll> lat = *(prqueue.begin());
			prqueue.erase(lat);
			vis[lat.ss]=1;
			for(auto e: edge[lat.ss])
			{
				if(vis[e])
					continue;
				if(weight[e][lat.ss] > lat.ff.cur && weight[e][lat.ss]<=cap)
				{
					newdist upd;
					upd.refills = lat.ff.refills+1;
					upd.cur = cap - weight[e][lat.ss];
					if(upd<src[dij][e])
						{
							prqueue.erase(mp(src[dij][e],e));
							src[dij][e] = upd;
							prqueue.insert(mp(src[dij][e],e));
							
						}	
				}
				else
				{
					newdist upd;
					upd.refills = lat.ff.refills;
					upd.cur = lat.ff.cur - weight[e][lat.ss];
					if(upd.cur<0)
						continue;
					if(upd<src[dij][e])
						{
							prqueue.erase(mp(src[dij][e],e));
							src[dij][e] = upd;
							prqueue.insert(mp(src[dij][e],e));
						}	
				}
			}

		}

	}

	ll q;
	cin>>q;
	while(q--)
	{
		ll s,t;
		cin>>s>>t;

	 ll ref=src[s][t].refills;
	 if(ref >=1e4)
	 	cout<<-1<<endl;
	 else
	 	cout<<ref<<endl;
	}





	

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:33: error: 'vis' was not declared in this scope
   73 |                                 vis[i]=0;
      |                                 ^~~
a.cc:82:25: error: 'vis' was not declared in this scope
   82 |                         vis[lat.ss]=1;
      |                         ^~~
Language: C++

#include<iostream>
#include<algorithm>
using lint=int64_t;
using namespace std;

constexpr int INF=1e18;

int main()
{
	int N,M,L;
	int A[310]={};
	int B[310]={};
	lint C[310]={};
	int Q;
	int s[100010]={};
	int t[100010]={};

	lint dist[310][310]={};
	for(int i=0;i<310;i++)
		for(int j=0;j<310;j++)
			if(i!=j)dist[i][j]=INF;

	cin >> N >> M >> L;
	for(int i=0;i<M;i++)
	{
		cin >> A[i];
		cin >> B[i];
		cin >> C[i];
		A[i]--;
		B[i]--;
		dist[A[i]][B[i]]=C[i];
		dist[B[i]][A[i]]=C[i];
	}
	cin >> Q;
	for(int i=0;i<Q;i++)
	{
		cin >> s[i];
		cin >> t[i];
		s[i]--;
		t[i]--;
	}

	for(int k=0;k<N;k++)
		for(int i=0;i<N;i++)
			for(int j=0;j<N;j++)
				dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);

	lint cnt[310][310]={};
	for(int i=0;i<310;i++)
		for(int j=0;j<310;j++)
			if(i!=j && dist[i][j]>L)cnt[i][j]=INF;
	
	for(int k=0;k<N;k++)
	{
		for(int i=0;i<N;i++)
		{
			for(int j=0;j<N;j++)
			{
				lint ncnt=cnt[i][k]+cnt[k][j];
				if(dist[i][k]+dist[k][j]>L)
					ncnt++;
				cnt[i][j]=min(cnt[i][j],ncnt);
			}
		}
	}

	for(int i=0;i<Q;i++)
	{
		lint ans=cnt[s[i]][t[i]];
		if(ans==INF)ans=-1;
		cout << ans << endl;
	}
	return 0;
}


Compiler output:
a.cc:6:19: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
    6 | constexpr int INF=1e18;
      |                   ^~~~
a.cc:6:19: error: overflow in constant expression [-fpermissive]
a.cc:6:19: error: overflow in constant expression [-fpermissive]
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define sz(x) ll(x.size())
using namespace std;

const ll INF=1e9+5;

int main() {
  ll n,m,l,q,s,t,buf1,buf2,buf3,ans,INF;
  cin >> n >> m >> l;
  vector<vector<ll>>ab(n,vector<ll>(n,INF));
  rep(i,m) {
  	cin >> buf1 >> buf2 >> buf3;
  	ab.at(buf1-1).at(buf2-1)=ab.at(buf2-1).at(buf1-1)=buf3;
  }
  rep(i,n) ab.at(i).at(i)=0;
  rep(k,n) rep(i,n) rep(j,n) ab.at(i).at(j)=min(ab.at(i).at(j),ab.at(i).at(k)+ab.at(k).at(j));
  rep(i,n) rep(j,n){
    if(ab.at(i).at(j)<=l) ab.at(i).at(j)=1;
    else ab.at(i).at(j)=INF;
  }
  rep(ik,n) rep(i,n) rep(j,n) ab.at(i).at(j)=min(ab.at(i).at(j),ab.at(i).at(k)+ab.at(k).at(j));				
  cin >> q;
  rep(i,q) {
  	cin >> s >> t;
    if(ab.at(s-1).at(t-1)==INF) ans=-1;
    else ans=ab.at(s-1).at(t-1)-1;
  	cout << ans << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:77: error: 'k' was not declared in this scope
   23 |   rep(ik,n) rep(i,n) rep(j,n) ab.at(i).at(j)=min(ab.at(i).at(j),ab.at(i).at(k)+ab.at(k).at(j));
      |                                                                             ^
Language: C++

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

void floyd_warshall(int n, int matrix[301][301]){
	for(int k=0; k< n; k++){
		for(int i=0; i<n; i++){
			for(int j=0; j< n; j++){
				if(matrix[i][k] != LLONG_MAX and matrix[k][j] != LLONG_MAX){
					if(matrix[i][k] + matrix[k][j] < matrix[i][j]){
						matrix[i][j] = matrix[i][k] + matrix[k][j];
						
					}
				}
			}
		}
	}
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n,m;
	int a,b;
	int q;
	ll l;
	ll c;
	cin>>n>>m>>l;
	ll matrix[301][301];
	ll cost[301][301];
	for(int i=0; i<301; i++){
		for(int j=0; j< 301; j++){
			if(i==j){
				matrix[i][j] = 0;
				cost[i][j] = 0;
			}
			else{
				matrix[i][j] = LLONG_MAX;
				cost[i][j] = LLONG_MAX;
			}
		}
	}
	while(m--){
		cin>>a>>b>>c;
		if(c <= l){
			matrix[a-1][b-1] = c;
			matrix[b-1][a-1] = c;
		}
	}
	floyd_warshall(n, matrix);
	for(int i=0; i<n; i++){
		for(int j=0; j<n; j++){
			if(i!=j)
				cost[i][j] = (matrix[i][j] <=l )? 1 : LLONG_MAX;		
		}
	}
	floyd_warshall(n, cost);
	// for(int i=0; i<n; i++){
	// 	for(int j=0; j< n; j++){
	// 		cout<<cost[i][j]<<" ";
	// 	}
	// 	cout<<"\n";
	// }
	cin>>q;
	while(q--){
		cin>>a>>b;
		if(cost[a-1][b-1] != LLONG_MAX){
			cout<<(cost[a-1][b-1]-1)<<"\n";
		}
		else{
			cout<<-1<<"\n";
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:27: error: cannot convert 'long long int (*)[301]' to 'int (*)[301]'
   49 |         floyd_warshall(n, matrix);
      |                           ^~~~~~
      |                           |
      |                           long long int (*)[301]
a.cc:5:32: note:   initializing argument 2 of 'void floyd_warshall(int, int (*)[301])'
    5 | void floyd_warshall(int n, int matrix[301][301]){
      |                            ~~~~^~~~~~~~~~~~~~~~
a.cc:56:27: error: cannot convert 'long long int (*)[301]' to 'int (*)[301]'
   56 |         floyd_warshall(n, cost);
      |                           ^~~~
      |                           |
      |                           long long int (*)[301]
a.cc:5:32: note:   initializing argument 2 of 'void floyd_warshall(int, int (*)[301])'
    5 | void floyd_warshall(int n, int matrix[301][301]){
      |                            ~~~~^~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=500;
typedef long long ll;
const ll inf=1e15+7;
ll arr[N][N];
ll brr[N][N];
int main(){
	ll n,m,l;
	cin>>n>>m>>l;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++){
			if(i!=j) arr[i][j]=brr[i][j]=inf;
		}
	
	ll x,y,z;
	
	for(int i=1;i<=m;i++){
		scanf("%lld%lld%lld",&x,&y,&z);
		arr[x][y]=z;
		arr[y][x]=z;
	}
	
	for(int k=1;i<=n;i++){
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;k++)
				arr[i][j]=min(arr[i][j],arr[i][k]+arr[k][j]);
	}
	
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++){
			if(arr[i][j]<=l&&i!=j) brr[i][j]=1; 
		}
	
	for(int k=1;k<=n;k++){
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				brr[i][j]=min(brr[i][j],brr[i][k]+brr[k][j]);
	}
	
	int q;
	cin>>q;
	while(q--){
		int a,b;
		cin>>a>>b;
		if(brr[a][b]>=inf) cout<<-1<<endl;
		else cout<<brr[a][b]-1<<endl;
	}	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: 'i' was not declared in this scope
   24 |         for(int k=1;i<=n;i++){
      |                     ^
Language: C++

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

#define FOR(i, m, n) for(int (i) = (m); (i) < (n); (i)++)
#define rep(i, n) FOR(i, 0, n)
#define co(n) cout << (n) << endl
#define cosp(n) cout << (n) << ' '
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P, ll> PP;

const ll INF = 1e18;
const ll MOD = 1e9+7;
//const ll MOD 998244353;
const ll MAX_N = 305;

ll d[MAX_N][MAX_N] = {};
ll dd[MAX_N][MAX_N] = {};

int main(void){
	int n, m, l;
	scanf("%d%d%d", &n, &m, &l);

	rep(i, n) rep(j, n) d[i][j] = INF;
	rep(i, n) d[i][i] = 0;

	rep(i, m){
		int a, b, c;
		scanf("%d%d%d", &a, &b, &c);
		a--; b--;
		d[a][b] = c;
		d[b][a] = c;
	}

	rep(k, n) rep(i, n) rep(j, n) d[i][j] = min(d[i][j], d[i][k]+d[k][j]);
	rep(i, n) rep(j, n){
		if(d[i][j] <= l) dd[i][j] = 1;
		else dd[i][j] = INF;
	}
	rep(i, n) dd[i][i] = 0;
	rep(k, n) rep(i, n) rep(j, n) dd[i][j] = min(dd[i][j], dd[i][k]+dd[k][j]);

	int q;
	cin >> q;
	rep(i, q){
		int s, t;
		scanf("%d%d", &s, &t);
		s--; t--;
		if(dd[s][t] != INF) printf("%d\n", dd[s][t]-1);
		else printf("-1\n", );;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:37: error: expected primary-expression before ')' token
   55 |                 else printf("-1\n", );;
      |                                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define Rep(i, r, n) for (ll i = r; i < n; i++)
#define debug(x) cout << #x << " = " << (x) << endl;
#define MOD 1000000007
#define EPS (1 >> 30)
#define INF (1 << 30)
//#define INFll (1LL << 60)
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

ll N,M,L,Q;
ll fuel[305][305];
ll dist[305][305];
ll s[105000],t[105000];
ll A[100000],B[100000],C[100000];

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    //---------------------------------------------

    cin>>N>>M>>L;
    for(int i = 1; i <= M; i++) cin >> A[i] >> B[i] >> C[i];
    cin >> Q;
    for(int i = 1; i <= Q; i++) cin >> s[i] >> t[i];
    Rep(i,1,N){
        Rep(j,1,N){
            fuel[i][j]=INF;
            dist[i][j]=INF;
        }
        fuel[i][i]=0;
        dist[i][i]=0;
    }
    Rep(i,1,N){
        chmin(fuel[A[i]][B[i]],C[i]);
        chmin(fuel[B[i]][A[i]],C[i]);
    }
    for(int i=1;i<=N;i++){
        for(int j=1;j<=N;j++){
            for(int k=1;k<=N;k++){
                chmin(fuel[j][k],fuel[j][i]+fuel[i][j]);
            }
        }
    }
    for(int i=1;i<=N;i++){
        for(int j=1;j<=N;j++){
            if(i==j)continue;
            if(fuel[i][j]<=L){
                chmin(dist[i][j],1LL);
            }
        }
    }
    for(int i=1;i<=N;i++){
        for(int j=1;j<=N;j++){
            for(int k=1;k<=N;k++){
                chmin(fuel[j][k],fuel[j][i]+fuel[i][j]);
            }
        }
    }
    for(int i=1;i<=Q;i++){
        if(dist[t[i]][s[i]<INF])cout<<dist[t[i]][s[i]]-1<<endl;
        else cout<<-1<<endl;
    }
}a

Compiler output:
a.cc:88:2: error: 'a' does not name a type
   88 | }a
      |  ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
template <class T>inline T updmax(T& a, T b) {return a = max(a, b);}
template <class T>inline T updmin(T& a, T b) {return a = min(a, b);}
 
template<class W>
 
class Solution {
public:
	void solve() {
		int n, m, l;
		cin >> n >> m >> l;
		vector<vector<int>> d(n, vector<int>(n, 0x3f3f3f3f)), d2(n, vector<int>(n, 0x3f3f3f3f));
		for(int i=0; i < m; i++){
			int a, b, c;
			cin >> a >> b >> c;
			a--, b--;
        	d2[a][b] = d2[b][a] = c;
		}
		for(int k=0; k < n; k++){
			for(int i=0; i < n; i++){
				for(int j=0; j < n; j++){
					updmin(d2[i][j], d2[i][k] + d2[k][j]);
				}
			}
		}
      	for(int i=0; i < n; i++)for(int j=0; j < n; j++)if(d2[i][j] <= l)d[i][j] = 1;
		for(int k=0; k < n; k++){
			for(int i=0; i < n; i++){
				for(int j=0; j < n; j++){
					updmin(d[i][j], d[i][k] + d[k][j]);
				}
			}
		}
 
		int Q;
		cin >> Q;
		for(int q=0; q < Q; q++){
			int s, t;
			cin >> s >> t;
			if(d[s-1][t-1] == 0x3f3f3f3f)cout << -1 << "\n";
			else cout << d[s-1][t-1]-1 << "\n";				
		}
 
	
		return;
	};
};
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:18: error: class template argument deduction failed:
   55 |         Solution solution;
      |                  ^~~~~~~~
a.cc:55:18: error: no matching function for call to 'Solution()'
a.cc:10:7: note: candidate: 'template<class W> Solution()-> Solution<W>'
   10 | class Solution {
      |       ^~~~~~~~
a.cc:10:7: note:   template argument deduction/substitution failed:
a.cc:55:18: note:   couldn't deduce template parameter 'W'
   55 |         Solution solution;
      |                  ^~~~~~~~
a.cc:10:7: note: candidate: 'template<class W> Solution(Solution<W>)-> Solution<W>'
   10 | class Solution {
      |       ^~~~~~~~
a.cc:10:7: note:   candidate expects 1 argument, 0 provided
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
template <class T>inline T updmax(T& a, T b) {return a = max(a, b);}
template <class T>inline T updmin(T& a, T b) {return a = min(a, b);}
 
template<class W>
 
class Solution {
public:
	void solve() {
		using pii = pair<int, int>;
		int n, m, l;
		cin >> n >> m >> l;
		graph<int> g(n);
		vector<vector<int>> d(n, vector<int>(n, 0x3f3f3f3f)), d2(n, vector<int>(n, 0x3f3f3f3f));
		for(int i=0; i < m; i++){
			int a, b, c;
			cin >> a >> b >> c;
			a--, b--;
        	d2[a][b] = d2[b][a] = c;
		}
		for(int k=0; k < n; k++){
			for(int i=0; i < n; i++){
				for(int j=0; j < n; j++){
					updmin(d2[i][j], d2[i][k] + d2[k][j]);
				}
			}
		}
      	for(int i=0; i < n; i++)for(int j=0; j < n; j++)if(d2[i][j] <= l)d[i][j] = 1;
		for(int k=0; k < n; k++){
			for(int i=0; i < n; i++){
				for(int j=0; j < n; j++){
					updmin(d[i][j], d[i][k] + d[k][j]);
				}
			}
		}
 
		int Q;
		cin >> Q;
		for(int q=0; q < Q; q++){
			int s, t;
			cin >> s >> t;
			if(d[s-1][t-1] == 0x3f3f3f3f)cout << -1 << "\n";
			else cout << d[s-1][t-1]-1 << "\n";				
		}
 
	
		return;
	};
};
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

Compiler output:
a.cc: In member function 'void Solution<W>::solve()':
a.cc:16:17: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   16 |                 graph<int> g(n);
      |                 ^~~~~
      |                 isgraph
a.cc:16:23: error: expected primary-expression before 'int'
   16 |                 graph<int> g(n);
      |                       ^~~
a.cc: In function 'int main()':
a.cc:57:18: error: class template argument deduction failed:
   57 |         Solution solution;
      |                  ^~~~~~~~
a.cc:57:18: error: no matching function for call to 'Solution()'
a.cc:10:7: note: candidate: 'template<class W> Solution()-> Solution<W>'
   10 | class Solution {
      |       ^~~~~~~~
a.cc:10:7: note:   template argument deduction/substitution failed:
a.cc:57:18: note:   couldn't deduce template parameter 'W'
   57 |         Solution solution;
      |                  ^~~~~~~~
a.cc:10:7: note: candidate: 'template<class W> Solution(Solution<W>)-> Solution<W>'
   10 | class Solution {
      |       ^~~~~~~~
a.cc:10:7: note:   candidate expects 1 argument, 0 provided
Language: C++

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

typedef long long ll;
# define  pii pair<ll,ll> 
# define pb push_back
# define f first 
# define s second 

class  node
{
   public:
   ll  b;
   ll  co;
   ll fuel;
    
};

vector<pii> Adj[1000001];


struct comp
{
        bool operator()(const node &a, const node &b)
        {
            return a.co > b.co;
        }
};






int main() {
    ll n,m,l;
    cin>>n>>m>>l;
    
    for(ll i=0;i<m;i++)
    {
        ll u,v,c;
        cin>>u>>v>>c;
        
        if(c>l) continue;
        Adj[u].pb(pii(v,c));
        Adj[v].pb(pii(u,c));
    }
    
    ll q;
    cin>>q;
    
    for(ll i=0;i<q;i++)
    { 
        
      
      ll dist[n+1];
      //ll fuel[n+1];
      ll vis[n+1];
      ll count[n+1];
      
     fill(dist,dist+n+1,INT_MAX);
     fill(count,count+n+1,INT_MAX);
    // memset(fuel,0,sizeof(fuel));
     memset(vis,0,sizeof(vis));
    // memset(count,IN,sizeof(count));
     
       ll s,des;
       cin>>s>>des;
       ll flag=0;
       
    
    priority_queue <node,vector<node>,comp> pq; //comp have to made;
    
    node mk;
    mk.b=s;
    mk.co=0;
    mk.fuel=l;
    pq.push(mk); 
    
    
    
    // start 
    // visited to be created
    // fuel have to be created
    // dist have to be created
    
    
    //ll cn=0;
    dist[s]=0;
    count[s]=0;
    //fuel[s]=l;
    // cout<<"s "<<s<<endl;
    while(!pq.empty())
    {
       node it= pq.top();
       pq.pop();
       
       ll vertex=it.b;
       
       if(vis[vertex]) 
       {
           //pq.pop();
           continue;
           
       }
      
       if(vertex==des) 
       {  
           flag=1;
           break;
       }
       
       //cout<<"vertex "<<vertex<<endl;
       vis[vertex]=1;
       
       for(auto iter: Adj[vertex])
       {
           if(!vis[v])
           {
               
               ll cn=0;
           ll v=iter.f;
           ll now_fuel=it.fuel;
           
           if(now_fuel>=iter.s) {now_fuel=now_fuel-iter.s;cn=0;}
           else {now_fuel=l-iter.s;cn=1;}
               
               
               
            if(  count[v]>count[vertex]+cn) 
               
               
               
               
               
               
               {
               
               
               count[v]=count[vertex]+cn;
               
               node myy;
               myy.b=v;
               myy.co=count[v];
               myy.fuel=now_fuel;
               pq.push(myy);
                   
               }
           }
       }
       
        
    }
    if(flag)
    cout<<count[des]<<endl;
    else cout<<"-1"<<endl;
    }
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:118:20: error: 'v' was not declared in this scope
  118 |            if(!vis[v])
      |                    ^
a.cc:122:15: error: redeclaration of 'll v'
  122 |            ll v=iter.f;
      |               ^
a.cc:118:20: note: '<typeprefixerror>v' previously declared here
  118 |            if(!vis[v])
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf=1e9+7;
const int N=500;
ll arr[N][N];
ll d[N][N];
ll main(){
	ios::sync_with_stdio(false);
	ll n,m,l;
	cin>>n>>m>>l;
	ll x,y,z;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(i==j) {
				arr[i][j]=0;
				d[i][j]=0;
			}
			else {
				arr[i][j]=inf;
				d[i][j]=inf;
			}
		}
	}
	for(int i=1;i<=m;i++) {
		cin>>x>>y>>z;
		arr[x][y]=z;
		arr[y][x]=z;
	}	
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			for(int k=1;k<=n;k++)
				arr[i][j]=min(arr[i][j],arr[i][k]+arr[k][j]);
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(arr[i][j]<=l) {
				d[i][j]=1;
			}
		}
	}
	
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			for(int k=1;k<=n;k++)
				d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
	
	int q;
	cin>>q;
	while(q--){
		int a,b;
		cin>>a>>b;
		if(arr[a][b]==inf) cout<<-1<<endl;
		else cout<<d[a][b]-1<<endl;
	}
	
	return 0;
} 

Compiler output:
a.cc:8:1: error: '::main' must return 'int'
    8 | ll main(){
      | ^~
Language: C++

from scipy.sparse.csgraph import dijkstra
import sys
input = sys.stdin.readline
def solve():
  inf = 0
  n,m,l = (int(i) for i in input().split())
  path = [[-1*inf]*n for _ in range(n)]
  for i in range(m):
    a,b,c = (int(i) for i in input().split())
    path[a-1][b-1] = c
    path[b-1][a-1] = c
  d = dijkstra(path)
  q = int(input())
  minipath = [[-1*inf]*n for _ in range(n)]
  for i in range(n):
    for j in range(n):
      if d[i][j] <= l:
        minipath[i][j] = 1
  d2 = dijkstra(minipath)

  for i in range(q):
    s,t = (int(i) for i in input().split())
    s,t = s-1,t-1
    cost = d2[s][t]
    if cost == inf:
      print(-1)
    else:
      print(int(cost)-1)

solve()

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from scipy.sparse.csgraph import dijkstra
      | ^~~~
Language: C++

#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>

#include <boost/heap/fibonacci_heap.hpp>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (const auto &e : vec) os << e << (&e == &vec.back() ? "\n" : " ");
	return os;
}

template <class T>
ostream &operator<<(ostream &os, const set<T> &st) {
	for (const auto &e : st) os << e << " ";
	return os;
}

template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}

template <class T1, class T2>
ostream &operator<<(ostream &os, const map<T1, T2> &mp) {
	for (const auto &e : mp) os << e << " ";
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

template<class T = lint>
struct Edge {
	int to;
	T cost;
	int tank;
	Edge() {}
	Edge(int to, T cost, int tank = 0) : to(to), cost(cost), tank(tank) {}
	bool operator>(const Edge &r) const { return this->cost > r.cost; }
};

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N, M, L;
	cin >> N >> M >> L;

	vector<vector<Edge<int>>> edges(N);
	for (int i = 0; i < M; i++) {
		int u, v, len;
		cin >> u >> v >> len;
		u--, v--;
		if (len > L) continue;
		edges[u].emplace_back(v, len);
		edges[v].emplace_back(u, len);
	}

	auto dijkstra = [&](int st) {
		vector<pair<int, int>> dp(N, { -INF, 0 });
		dp[st] = { 0, L };
		using ppi = pair<pair<int, int>, int>;
		boost::heap::fibonacci_heap<ppi> que;
		que.emplace(dp[st], st);
		while (!que.empty()) {
			auto now = que.top();
			que.pop();

			if (now.first < dp[now.second]) continue;

			for (const auto &e : edges[now.second]) {

				auto tmp = now.first;
				if (e.cost > tmp.second) {
					tmp.first--;
					tmp.second = L - e.cost;
				}
				else tmp.second -= e.cost;

				if (tmp > dp[e.to]) {
					dp[e.to] = tmp;
					que.update(handles[e.to], ppi(tmp, e.to));
				}

			}
		}
		return dp;
	};

	vector<vector<pair<int, int>>> memo(N);
	for (int i = 0; i < N; i++) memo[i] = dijkstra(i);

	int Q;
	cin >> Q;
	for (int i = 0; i < Q; i++) {
		int s, t;
		cin >> s >> t;
		s--, t--;
		auto tmp = memo[s][t].first;
		if (tmp != -INF) cout << -tmp << "\n";
		else cout << -1 << "\n";
	}

	return 0;
}

Compiler output:
a.cc:14:10: fatal error: boost/heap/fibonacci_heap.hpp: No such file or directory
   14 | #include <boost/heap/fibonacci_heap.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (const auto &e : vec) os << e << (&e == &vec.back() ? "\n" : " ");
	return os;
}

template <class T>
ostream &operator<<(ostream &os, const set<T> &st) {
	for (const auto &e : st) os << e << " ";
	return os;
}

template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}

template <class T1, class T2>
ostream &operator<<(ostream &os, const map<T1, T2> &mp) {
	for (const auto &e : mp) os << e << " ";
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

template<class T = lint>
struct Edge {
	int to;
	T cost;
	int tank;
	Edge() {}
	Edge(int to, T cost, int tank = 0) : to(to), cost(cost), tank(tank) {}
	bool operator>(const Edge &r) const { return this->cost > r.cost; }
};

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N, M, L;
	cin >> N >> M >> L;

	vector<vector<Edge<int>>> edges(N);
	for (int i = 0; i < M; i++) {
		int u, v, len;
		cin >> u >> v >> len;
		u--, v--;
		edges[u].emplace_back(v, len);
		edges[v].emplace_back(u, len);
	}

	auto bfs = [&](int st) {
		vector<pair<int, int>> dp(N, { INF, 0 });
		dp[st] = { 0, -L };
		queue<pair<int, pair<int, int>>> que;
		que.emplace(st, dp[st]);
		while (!que.empty()) {
			auto now = que.top();
			que.pop();
			for (const auto &e : edges[now.first]) {

				if (e.cost > L || now.second.first > dp[e.to].first) continue;

				auto tmp = now.second;
				if (e.cost > -tmp.second) {
					tmp.first++;
					tmp.second = -L + e.cost;
				}
				else tmp.second += e.cost;

				if (tmp < dp[e.to]) {
					dp[e.to] = tmp;
					que.emplace(e.to, tmp);
				}

			}
		}
		return move(dp);
	};

	vector<vector<pair<int, int>>> memo(N);
	for (int i = 0; i < N; i++) memo[i] = bfs(i);

	int Q;
	cin >> Q;
	for (int i = 0; i < Q; i++) {
		int s, t;
		cin >> s >> t;
		s--, t--;
		auto tmp = memo[s][t].first;
		if (tmp != INF) cout << tmp << "\n";
		else cout << -1 << "\n";
	}

	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:89:40: error: 'class std::queue<std::pair<int, std::pair<int, int> > >' has no member named 'top'; did you mean 'pop'?
   89 |                         auto now = que.top();
      |                                        ^~~
      |                                        pop