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

public class Main{
    
    static final int MAX = (int)1e9+1;
    
    /*
    이문제는 도시를 여행하는데,
    도시를 여행할때마다 L이라는 연료가 소모되고 각 도시를 지나갈때마다 연료를 충전할 수 있다.
    우리가 찾고자 하는것은 최소한의 연료충전으로 도시를 까지 여행할 수 있는 충전 횟수를 구하는것이 목표이다.
    Q로 여러개의 질답이 나오기 때문에 미리 행렬에 최단거리 ( L을 거리로 친다.)를 기록하는것이 더 유리하다.
    
    */
    public static int[][] maps=new int[301][301];
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n,m,l,a,b,c,q,s,t;
        n=sc.nextInt();
        m=sc.nextInt();
        l=sc.nextInt();
        for(int i=0;i<n;i++) {
        	for(int j=0;j<n;j++) {
        		maps[i][j]=MAX;
        	}
        }
        for(int i=0;i<n;i++) {
        	maps[i][i]=0;
        }
        for(int i=0;i<m;i++) {
        	a=sc.nextInt()-1;
        	b=sc.nextInt()-1;
        	c=sc.nextInt();
        	maps[a][b]=c;
        	maps[b][a]=c;
        }
        
        //첫번째 floyd
        for(int i=0;i<n;i++) {
        	for(int j=0;j<n;j++) {
        		for(int k=0;k<n;k++) {
        			int sum=maps[j][i]+maps[i][k];
        			maps[j][k]=Math.min(sum, maps[j][k]);
        		}
        	}
        }
        
        //걸러낸다 !
        for(int i=0;i<n;i++) {
        	for(int j=0;j<n;j++) {
        		if(maps[i][j]<=l)
        			maps[i][j]=1;
        		else
        			maps[i][j]=MAX;
        	}
        }
        
        //다시한번 floyd
        for(int i=0;i<n;i++) {
        	for(int j=0;j<n;j++) {
        		for(int k=0;k<n;k++) {
        			int sum=maps[j][i]+maps[i][k];
        			maps[j][k]=Math.min(sum, maps[j][k]);
        		}
        	}
        }
        
        
        q=sc.nextInt();
        for(int i=0;i<q;i++) {
        	s=sc.nextInt()-1;
        	t=sc.nextInt()-1;
        	int ans=maps[s][t];
        	if(ans==MAX)
        		System.out.println(-1);
        	else
        		System.out.println(ans-1);
        }
        
    }
}


Compiler output:
Main.java:14: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:14: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import javafx.scene.layout.Priority;

import java.util.*;
import java.io.*;

public class Main {

    static class Town implements Comparable<Town>{
        int dist;
        int i;

        public Town(int i){
            dist = Integer.MAX_VALUE;
            this.i = i;
        }

        public int compareTo(Town t){
            return this.dist - t.dist;
        }
    }

    public static void main(String[] args) throws IOException {
        //Scanner sc = new Scanner(System.in);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("Main.out");

        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int l = Integer.parseInt(st.nextToken());

        int[][] adj = new int[n+1][n+1];
        int[][] minDist = new int[n+1][n+1];
        Town[] list = new Town[n+1];

        for(int i = 1; i<=n; i++){
            list[i] = new Town(i);
        }


        for(int i = 0; i<m; i++){
            st = new StringTokenizer(br.readLine());
            int ai = Integer.parseInt(st.nextToken());
            int bi = Integer.parseInt(st.nextToken());
            int ci = Integer.parseInt(st.nextToken());
            adj[ai][bi] = ci;
            adj[bi][ai] = ci;
        }

        st = new StringTokenizer(br.readLine());

        for(int i = 1; i<=n; i++){
            Town source = list[i];
            boolean[] visited = new boolean[n+1];
            source.dist = 0;
            PriorityQueue<Town> pq = new PriorityQueue<Town>();
            pq.add(source);

            while(!pq.isEmpty()){
                Town s = pq.poll();
                visited[s.i] = true;
                for(int j = 1; j<=n; j++){
                    if(adj[s.i][j] > 0 && !visited[j]){
                        if(s.dist + adj[s.i][j] < list[j].dist){
                            list[j].dist = s.dist + adj[s.i][j];
                            pq.add(list[j]);
                        }
                    }
                }
            }
            for(int j = 1; j <= n; j++){
                minDist[i][j] = list[j].dist;
                list[j].dist = Integer.MAX_VALUE;
            }
        }

        int q = Integer.parseInt(st.nextToken());
        for(int i = 0; i<q; i++){
            st = new StringTokenizer(br.readLine());
            int s1 = Integer.parseInt(st.nextToken());
            int t1 = Integer.parseInt(st.nextToken());

            if(minDist[s1][t1] != Integer.MAX_VALUE){
                System.out.println(minDist[s1][t1] / l);
            }
            else{
                System.out.println(-1);
            }
        }
    }
}

Compiler output:
Main.java:1: error: package javafx.scene.layout does not exist
import javafx.scene.layout.Priority;
                          ^
1 error
Language: C

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int N,M,L;
int P[301][301];
pair<int,int>D[301][301];
vector<pair<int,int> >G[301];
main()
{
	cin>>N>>M>>L;
	for(int i=0;i<M;i++)
	{
		int a,b,c;cin>>a>>b>>c;
		G[a].push_back(make_pair(b,c));
		G[b].push_back(make_pair(a,c));
	}
	for(int k=1;k<=N;k++)
	{
		for(int i=1;i<=N;i++)
		{
			P[k][i]=-1;
			D[k][i]=make_pair(1e9,0);
		}
		P[k][k]=k;
		D[k][k]=make_pair(0,L);
		priority_queue<pair<pair<int,int>,int> >Q;
		Q.push(make_pair(make_pair(0,L),k));
		while(!Q.empty())
		{
			int u=Q.top().second;
			int cnt=-Q.top().first.first;
			int now=Q.top().first.second;
			Q.pop();
			if(D[k][u].first<cnt||D[k][u].first==cnt&&D[k][u].second>now)continue;
			for(pair<int,int>p:G[u])
			{
				int v=p.first;
				int nxtc=cnt;
				int nxtnow;
				if(now>=p.second)nxtnow=now-p.second;
				else if(L>=p.second)nxtnow=L-p.second,nxtc++;
				else continue;
				if(D[k][v].first>nxtc||D[k][v].first==nxtc&&D[k][v].second<nxtnow)
				{
					D[k][v]=make_pair(nxtc,nxtnow);
					Q.push(make_pair(make_pair(-nxtc,nxtnow),v));
				}
			}
		}
	}
	int Q;
	cin>>Q;
	for(;Q--;)
	{
		int s,t;cin>>s>>t;
		int ans=D[s][t].first;
		if(ans<1e9)cout<<ans<<endl;
		else cout<<-1<<endl;
	}
}


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

#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>

using namespace std;

#define INF 1e9

int n, m, l;
vector<vector<pair<int, int> > > H;
vector<vector<int> > G;

void dfs(int s,int now,int pre,int sum) {
	if (sum > l) return;
	if (G[s][now] != INF) return;
	G[s][now] = 0;
	for (auto e : H[now])
		if(e.first != pre) dfs(s, e.first, sum + e.second);
}

void warshall_froyd() {
	for (int k = 0; k < n; k++) {
		for (int i = 0; i < n; ++i) {
			if (G[i][k] == INF) continue;
			for (int j = 0; j < n; ++j) {
				if (G[k][j] == INF) continue;
				G[i][j] = min(G[i][j], G[i][k] + G[k][j] + 1);
			}
		}
	}
}

int main() {
	cin >> n >> m >> l;
	H.assign(n, vector<pair<int, int> >());
	G.assign(n, vector<int>(n, INF));
	for (int i = 0; i < m; ++i) {
		int a, b, c; cin >> a >> b >> c;
		--a, --b;
		H[a].emplace_back(b, c);
		H[b].emplace_back(a, c);
	}
	for (int i = 0; i < n; ++i) dfs(i, i, 0);
	warshall_froyd();
	int q; cin >> q;
	while (q--) {
		int s, t; cin >> s >> t;
		--s, --t;
		int ans = min(G[s][t], G[t][s]);
		cout << (ans == INF ? -1 : ans) << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int, int)':
a.cc:19:39: error: too few arguments to function 'void dfs(int, int, int, int)'
   19 |                 if(e.first != pre) dfs(s, e.first, sum + e.second);
      |                                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:14:6: note: declared here
   14 | void dfs(int s,int now,int pre,int sum) {
      |      ^~~
a.cc: In function 'int main()':
a.cc:44:40: error: too few arguments to function 'void dfs(int, int, int, int)'
   44 |         for (int i = 0; i < n; ++i) dfs(i, i, 0);
      |                                     ~~~^~~~~~~~~
a.cc:14:6: note: declared here
   14 | void dfs(int s,int now,int pre,int sum) {
      |      ^~~
Language: C++

#include <bits/stdc++.h>
//#pragma GCC optimize("Ofast")
#define fori(a,b) for(int i=a;i<b;i++)
#define forj(a,b) for(int j=a;j<b;j++)
#define fork(a,b) for(int k=a;k<b;k++)
#define ford(i,a,b) for(int i=a;i>=b;i--)
#define seto(x,i) memset(x,i,sizeof x)
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
#define pf first
#define ps second
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;

const int N=301;
ll n,m,L,q,a,b,c,dist[N][N],df[N][N];
vector<pii> gr[N];
queue<pair<pii,int>> toV;

void dfs()
{
    int v=toV.top().ps; toV.pop();
    for(auto i:gr[v])
    {
        if(df[a][v]>=i.ps&&(dist[a][i.pf]>dist[a][v]||dist[a][i.pf]==dist[a][v]&&df[a][i.pf]<df[a][v]-i.ps))
        {
            dist[a][i.pf]=dist[a][v]; df[a][i.pf]=df[a][v]-i.ps;
            toV.push({{-dist[a][i.pf],df[a][i.pf]},i.pf});
        }
        if(df[a][v]<i.ps&&i.ps<=L&&(dist[a][i.pf]>dist[a][v]+1||dist[a][i.pf]==dist[a][v]+1&&df[a][i.pf]<L-i.ps))
        {
            dist[a][i.pf]=dist[a][v]+1; df[a][i.pf]=L-i.ps;
            toV.push({{-dist[a][i.pf],df[a][i.pf]},i.pf});
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    //freopen("", "r", stdin);
    cin>>n>>m>>L;
    fori(0,m)
    {
        cin>>a>>b>>c; a--; b--;
        gr[a].push_back({b,c});
        gr[b].push_back({a,c});
    }
    fori(0,n)
    {
        forj(0,n)
            dist[i][j]=df[i][j]=INF;
        a=i; dist[a][a]=0; df[a][a]=L; toV.push({{0,L},a});
        while(!toV.empty())
            dfs();
    }
    cin>>q;
    fori(0,q)
    {
        cin>>a>>b; a--; b--;
        cout<<(dist[a][b]==INF? -1: dist[a][b])<<"\n";
    }
    return 0;
}


Compiler output:
a.cc: In function 'void dfs()':
a.cc:23:15: error: 'class std::queue<std::pair<std::pair<long long int, long long int>, int> >' has no member named 'top'; did you mean 'pop'?
   23 |     int v=toV.top().ps; toV.pop();
      |               ^~~
      |               pop
a.cc:10:12: warning: narrowing conversion of 'i.std::pair<long long int, long long int>::first' from 'long long int' to 'int' [-Wnarrowing]
   10 | #define pf first
      |            ^
a.cc:29:54: note: in expansion of macro 'pf'
   29 |             toV.push({{-dist[a][i.pf],df[a][i.pf]},i.pf});
      |                                                      ^~
a.cc:10:12: warning: narrowing conversion of 'i.std::pair<long long int, long long int>::first' from 'long long int' to 'int' [-Wnarrowing]
   10 | #define pf first
      |            ^
a.cc:34:54: note: in expansion of macro 'pf'
   34 |             toV.push({{-dist[a][i.pf],df[a][i.pf]},i.pf});
      |                                                      ^~
a.cc: In function 'int main()':
a.cc:54:56: warning: narrowing conversion of 'a' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   54 |         a=i; dist[a][a]=0; df[a][a]=L; toV.push({{0,L},a});
      |                                                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int maxn = 310;
int n, m , l;
const int inf = 1e9 + 1;
int ans[305][305];
bool vis[305];
vector<pair<int,int>> a[maxn];
using pii = pair<int,int>;
#define mp make_pair
bool cmp(const pii & x, const pii &y){
    if(x.first == y.first) return x.second > y.second;
    return x.first < y.first;
}
pair<int,int> dp[305];
struct S{
    int nod, cnt, val;
    S(int x,int y,int z) : nod(x) , cnt(y), val(z){}
    bool operator <(const S &x) const{
        if(cnt == x.cnt) return val < x.val;
        return cnt > x.cnt;
    }
}p;

void greedy(int start){
    priority_queue<S> q;
    for(int i = 1 ;i <= n + 1;i ++){
        dp[i] = mp(inf , -1);
        vis[i] = false;
    }
    dp[start] = make_pair(0 , l);
    q.push(S(start, 0 , l));
    while(!q.empty()){
        p = q.top();
        q.pop();
        if(vis[p.nod]) continue;
        for(auto i:a[p.nod]){
            if(!vis[i.first] && p.val >= i.second && cmp(mp(p.cnt,p.val - i.second), dp[i.first])){
                q.push(S(i.first, p.cnt, p.val - i.second));
                dp[i.first] = mp(p.cnt, p.val - i.second);
            }
            else if(!vis[i.first] && p.val < i.second && cmp(mp(p.cnt + 1, l - i.second) , dp[i.first])){
                q.push(S(i.first, p.cnt + 1 , l - i.second));
                dp[i.first] = mp(p.cnt + 1, l  - i.second);
            }
        }
    }
    for(int i = 1 ;i <= n;i ++){
        if(i != start){
            if(dp[i] != mp(inf,-1)){
                ans[start][i] = dp[i].first;
            }
            else ans[start][i] = -1;
        }
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin >> n >> m >> l;
    int x,y,z;
    while(m -- ){
        cin >> x >> y >> z;
        if(z > l) continue;
        a[x].push_back({y, z});
        a[y].push_back({x, z});
    }
    for(int i = 1 ;i<= n;i++){
        greedy(i);
    }
    int q;
    cin >> q;
    while(q -- ){
        cin >> x >> y;
        cout <<ans[x][y] << '\n';
    }
}
/*
    Good Luck
        -Lucina
*/


Compiler output:
a.cc:23:2: error: no matching function for call to 'S::S()'
   23 | }p;
      |  ^
a.cc:18:5: note: candidate: 'S::S(int, int, int)'
   18 |     S(int x,int y,int z) : nod(x) , cnt(y), val(z){}
      |     ^
a.cc:18:5: note:   candidate expects 3 arguments, 0 provided
a.cc:16:8: note: candidate: 'constexpr S::S(const S&)'
   16 | struct S{
      |        ^
a.cc:16:8: note:   candidate expects 1 argument, 0 provided
a.cc:16:8: note: candidate: 'constexpr S::S(S&&)'
a.cc:16:8: note:   candidate expects 1 argument, 0 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int maxn = 310;
int n, m , l;
const int inf = 1e9 + 1;
int ans[305][305];
bool vis[305];
vector<pair<int,int>> a[maxn];
using pii = pair<int,int>;
#define mp make_pair
bool cmp(const pii & x, const pii &y){
    if(x.first == y.first) return x.second > y.second;
    return x.first < y.first;
}
pair<int,int> dp[305];
struct S{
    int nod, cnt, val;
    S(int x,int y,int z) : nod(x) , cnt(y), val(z){}
    bool operator <(const S &x) const{
        if(cnt == x.cnt) return val < x.val;
        return cnt > x.cnt;
    }
}p;

void greedy(int start){
    priority_queue<S> q;
    for(int i = 1 ;i <= n + 1;i ++){
        dp[i] = mp(inf , -1);
        vis[i] = false;
    }
    dp[start] = make_pair(0 , l);
    q.push(S(start, 0 , l));
    while(!q.empty()){
        p = q.top();
        q.pop();
        if(vis[p.nod]) continue;
        for(auto i:a[p.nod]){
            if(!vis[i.first] && p.val >= i.second && cmp(mp(p.cnt,p.val - i.second), dp[i.first])){
                q.push(S(i.first, p.cnt, p.val - i.second));
                dp[i.first] = mp(p.cnt, p.val - i.second);
            }
            else if(!vis[i.first] && p.val < i.second && cmp(mp(p.cnt + 1, l - i.second) , dp[i.first])){
                q.push(S(i.first, p.cnt + 1 , l - i.second));
                dp[i.first] = mp(p.cnt + 1, l  - i.second);
            }
        }
    }
    for(int i = 1 ;i <= n;i ++){
        if(i != start){
            if(dp[i] != mp(inf,-1)){
                ans[start][i] = dp[i].first;
            }
            else ans[start][i] = -1;
        }
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin >> n >> m >> l;
    int x,y,z;
    while(m -- ){
        cin >> x >> y >> z;
        if(z > l) continue;
        a[x].push_back({y, z});
        a[y].push_back({x, z});
    }
    for(int i = 1 ;i<= n;i++){
        greedy(i);
    }
    int q,x,y;
    cin >> q;
    while(q -- ){
        cin >> x >> y;
        cout <<ans[x][y] << '\n';
    }
}
/*
    Good Luck
        -Lucina
*/


Compiler output:
a.cc:23:2: error: no matching function for call to 'S::S()'
   23 | }p;
      |  ^
a.cc:18:5: note: candidate: 'S::S(int, int, int)'
   18 |     S(int x,int y,int z) : nod(x) , cnt(y), val(z){}
      |     ^
a.cc:18:5: note:   candidate expects 3 arguments, 0 provided
a.cc:16:8: note: candidate: 'constexpr S::S(const S&)'
   16 | struct S{
      |        ^
a.cc:16:8: note:   candidate expects 1 argument, 0 provided
a.cc:16:8: note: candidate: 'constexpr S::S(S&&)'
a.cc:16:8: note:   candidate expects 1 argument, 0 provided
a.cc: In function 'int main()':
a.cc:72:11: error: redeclaration of 'int x'
   72 |     int q,x,y;
      |           ^
a.cc:62:9: note: 'int x' previously declared here
   62 |     int x,y,z;
      |         ^
a.cc:72:13: error: redeclaration of 'int y'
   72 |     int q,x,y;
      |             ^
a.cc:62:11: note: 'int y' previously declared here
   62 |     int x,y,z;
      |           ^
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() ? "" : " ");
	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

int main() {

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

	int N;
	cin >> N;

	vector<int> L(N);
	for (int i = 0; i < N; i++) cin >> L[i];
	sort(L.begin(), L.end());

	int ans = 0;
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			ans += (lower_bound(L.begin(), L.end(), L[i] + L[j]) - (L.begin() + j + 1));
		}
	}

	cout << ans << "\n";

	return 0;
}


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

#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}

vector<int> G[300];

int main(){
  
  int n,m;
  long long l;
  cin>>n>>m>>l;
  
  int a,b;
  long long c;
  //long long w[n][n];
  vector<vector<long long>> dist(n, vector<long long>(n, INF));
  REP(i,n){
    dist[i][i] = 0;
  }
  REP(i,m){
    cin>>a>>b>>c;
    a--;b--;
    if(c>=l)continue;
    //G[a].push_back(b);
    //G[b].push_back(a);
    //w[a][b] = w[b][a] = c;
    dist[a][b] = dist[b][a] = c;
  }
  
  REP(k,n){
    REP(i,n){
      REP(j,n){
        if(dist[i][j] > dist[i][k] + dist[k][j]){
          dist[i][j] = dist[i][k] + dist[k][j];
        }
      }
    }
  }
  /*
  vector<vector<int>> next_(n, vector<int>(n, -1));
  REP(i,n){
    REP(j,n){
      for(int k:G[i]){
        if(dist[i][k] + dist[k][j] == dist[i][j]){
          next_[i][j] = k;
        }
      }
    }
  }
  */
  
  vector<vector<long long>> dist2(n, vector<long long>(n, INF));
  REP(i,n){
    dist2[i][i] = 0;
  REP(i,n){
    REP(j,n){
      if(dist[i][j] < l){
        dist2[i][j] = 1;
      }
    }
  }
  
  REP(k,n){
    REP(i,n){
      REP(j,n){
        if(dist2[i][j] > dist2[i][k] + dist2[k][j]){
          dist2[i][j] = dist2[i][k] + dist2[k][j];
        }
      }
    }
  }
  
  int q;
  cin>>q;
  int s,t;
  REP(i,q){
    cin>>s>>t;
    s--;t--;
    if(dist[s][t] == INF){
      cout<<-1<<endl;
      continue;
    }

    int res;
    /*
    int now = s;
    long long cap = l;
    while(now != t){
      int n = next_[now][t];
      if(w[now][n]>=cap){
        res++;
        cap = l;
        cap -= w[now][n];
      }else{
        cap -= w[now][n];
      }
      now = n;
    }
    */
    
    res = dist2[s][t];
    res--;
    cout<<res<<endl;
  }
  
  return 0;
}


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

#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}

vector<int> G[300];

int main(){
  
  int n,m;
  long long l;
  cin>>n>>m>>l;
  
  int a,b;
  long long c;
  //long long w[n][n];
  vector<vector<long long>> dist(n, vector<long long>(n, INF));
  REP(i,n){
    dist[i][i] = 0;
  }
  REP(i,m){
    cin>>a>>b>>c;
    a--;b--;
    if(c>=l)continue;
    //G[a].push_back(b);
    //G[b].push_back(a);
    //w[a][b] = w[b][a] = c;
    dist[a][b] = dist[b][a] = c;
  }
  
  REP(k,n){
    REP(i,n){
      REP(j,n){
        if(dist[i][j] > dist[i][k] + dist[k][j]){
          dist[i][j] = dist[i][k] + dist[k][j];
        }
      }
    }
  }
  /*
  vector<vector<int>> next_(n, vector<int>(n, -1));
  REP(i,n){
    REP(j,n){
      for(int k:G[i]){
        if(dist[i][k] + dist[k][j] == dist[i][j]){
          next_[i][j] = k;
        }
      }
    }
  }
  */
  
  vector<vector<int>> dist2(n, vector<int>(n, INF));
  REP(i,n){
    dist2[i][i] = 0;
  REP(i,n){
    REP(j,n){
      if(dist[i][j] < l){
        dist2[i][j] = 1;
      }
    }
  }
  
  REP(k,n){
    REP(i,n){
      REP(j,n){
        if(dist2[i][j] > dist2[i][k] + dist2[k][j]){
          dist2[i][j] = dist2[i][k] + dist2[k][j];
        }
      }
    }
  }
  
  int q;
  cin>>q;
  int s,t;
  REP(i,q){
    cin>>s>>t;
    s--;t--;
    if(dist[s][t] == INF){
      cout<<-1<<endl;
      continue;
    }

    int res;
    /*
    int now = s;
    long long cap = l;
    while(now != t){
      int n = next_[now][t];
      if(w[now][n]>=cap){
        res++;
        cap = l;
        cap -= w[now][n];
      }else{
        cap -= w[now][n];
      }
      now = n;
    }
    */
    
    res = dist2[s][t];
    res--;
    cout<<res<<endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: warning: overflow in conversion from 'double' to 'std::vector<int>::value_type' {aka 'int'} changes value from '1.0e+17' to '2147483647' [-Woverflow]
    7 | #define INF (1e17)
      |             ~^~~~~
a.cc:98:47: note: in expansion of macro 'INF'
   98 |   vector<vector<int>> dist2(n, vector<int>(n, INF));
      |                                               ^~~
a.cc:153:2: error: expected '}' at end of input
  153 | }
      |  ^
a.cc:53:11: note: to match this '{'
   53 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll=long long;

struct val{
    ll cnt=0;
    ll resf=1000000001;
    val(){}
    val(ll cnt,ll resf):cnt(cnt),resf(resf){}

    friend bool operator<(const val &lhs,const val &rhs){
        if(lhs.cnt<rhs.cnt)return true;
        else if(lhs.cnt>rhs.cnt)return false;
        else if(lhs.resf<rhs.resf)return false;
    }
};

int main(){
    ll n,m,l;
    cin>>n>>m>>l;
    vector<vector<ll>> G(n,vector<ll>(n,l*2));
    for (ll i = 0; i < m; ++i) {
        ll a,b,c;
        cin>>a>>b>>c;
        if(c>l)continue;
        --a,--b;
        G[a][b]=c;
        G[b][a]=c;
    }
    ll q;
    cin>>q;
    vector<vector<val>> ans(n);
    for (ll i = 0; i < n; ++i) {
        ll s;
        s=i;
        vector<val> dp(n,val(-1,-1));
        dp[s]=val(0,l);
        priority_queue<pair<val,ll>,vector<pair<val,ll>>,greater<pair<val,ll>>> pq;
        pq.push(make_pair(val(0,l),s));
        while(!pq.empty()){
            auto tp=pq.top();
            pq.pop();
            for (ll j = 0; j < n; ++j) {
                ll nc=G[tp.second][j];
                if(j==tp.second)continue;
                if(nc>l)continue;
                if(tp.first.resf>=nc){
                    val nt(tp.first.cnt,tp.first.resf-nc);
                    if(dp[j].cnt<0||nt<dp[j]){
                        dp[j]=nt;
                        pq.push(make_pair(nt,j));
                    }
                    val ntt(tp.first.cnt+1,l-nc);
                    if(dp[j].cnt<0||ntt<dp[j]){
                        dp[j]=ntt;
                        pq.push(make_pair(ntt,j));
                    }
                }
                else{
                    val nt(tp.first.cnt+1,tp.first.resfl-nc);
                    if(dp[j].cnt<0||nt<dp[j]){
                        dp[j]=nt;
                        pq.push(make_pair(nt,j));
                    }
                }
            }
        }
        ans[i]=dp;
    }
    for (ll i = 0; i < q; ++i) {
        ll s,t;
        cin>>s>>t;
        --s;--t;
        cout<<ans[s][t].cnt<<"\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:52: error: 'struct val' has no member named 'resfl'; did you mean 'resf'?
   61 |                     val nt(tp.first.cnt+1,tp.first.resfl-nc);
      |                                                    ^~~~~
      |                                                    resf
a.cc: In function 'bool operator<(const val&, const val&)':
a.cc:16:5: warning: control reaches end of non-void function [-Wreturn-type]
   16 |     }
      |     ^
Language: C++

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

INF=1001001001;

int main(void){
    int n, m, l;
    cin>>n>>m>>l;
    vector<vector<int>> dist(n, vector<int>(n, INF));
    rep(i, n){
        dist[i][i]=0;
    }
    rep(i,m){   
        int a, b, c;
        cin>>a>>b>>c;
        --a;--b;
        dist[a][b]=dist[b][a]=c;
    }

    rep(k, n)rep(i, n)rep(j, n) dist[i][j]=min(dist[i][j], dist[i][k]+dist[k][j]);
    vector<vector<int>> dist2(n, vector<int>(n, INF));
    rep(i, n)rep(j, n){
        if(dist[i][j]==l) dist2[i][j]=1;
    }
    rep(k, n)rep(i, n)rep(j, n) dist2[i][j]=min(dist2[i][j], dist2[i][k]+dist2[k][j]);

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

}

Compiler output:
a.cc:6:1: error: 'INF' does not name a type
    6 | INF=1001001001;
      | ^~~
a.cc: In function 'int main()':
a.cc:11:48: error: 'INF' was not declared in this scope
   11 |     vector<vector<int>> dist(n, vector<int>(n, INF));
      |                                                ^~~
Language: C++

#include <iostream>
#include <vector>
#include <utility>
#include <set>

using namespace std;

int numberOfTowns;
int numberOfEdges;
long capacityOfTank;

vector<vector<long>> path;
vector<vector<int>> edges;

int minChargeSoFar;

void findMinChargeAux(int src,int dst,long fuel,int charge){
    if(charge >= minChargeSoFar){
        return ;
    }
    if(path[src][dst]!=0){ // 道を見つけた
        if(path[src][dst]<=fuel){
            minChargeSoFar = charge;
        }else if(path[src][dst] <= capacityOfTank){
            minChargeSoFar = charge+1;
        }else{ 
            // 燃料を補給してもたどり着けない
        }
    }else{
        for(auto i : edges[src]){
//        for(int i=0;i<numberOfTowns;++i){
            int c = path[src][i];
            if(c!=0){
                path[src][i] = path[i][src] = 0;
                if(fuel >= c){
                    findMinChargeAux(i,dst,fuel - c,charge);
                }else if(capacityOfTank >= c){
                    findMinChargeAux(i,dst,capacityOfTank - c,charge+1);
                }else{
                    // 燃料を補給してもたどり着けない
                }
                path[src][i] = path[i][src] = c;
            }
        }
    }
}

int findMinCharge(int src,int dst){
    minChargeSoFar = numberOfTowns;
    findMinChargeAux(src,dst,capacityOfTank,0);
    return (minChargeSoFar < numberOfTowns) ? minChargeSoFar : -1;
}

int main(){
    cin >> numberOfTowns >> numberOfEdges >> capacityOfTank;
    vector<vector<long>> p(numberOfTowns,vector<long>(numberOfTowns,0));
    vector<vector<int>> e(numberOfTowns);

    for(int i=0;i<numberOfEdges;++i){
        int a,b;
        long c;
        cin >> a >> b >> c;
        a--;
        b--;
        p[a][b] = p[b][a] = c;
        e[a].push_back(b);
        e[b].push_back(a);
    }
    path = p;
    edges = e;
    for(int i=0;i<edges.size();i++){
        vector<long> vs = path[i];
        sort(edges[i].begin(),edges[i].end(),[vs](int v,int w){
            return vs[v] < vs[w];
        });
    }

    int numberOfQueries; // number of queries
    cin >>  numberOfQueries;
    vector<pair<int,int>> qs;
    for(int i=0;i<numberOfQueries;i++){
        int s,t;
        cin >> s >> t;
        qs.push_back(make_pair(s-1,t-1));
    }
    for(auto q:qs){
        cout << findMinCharge(q.first,q.second) << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:73:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   73 |         sort(edges[i].begin(),edges[i].end(),[vs](int v,int w){
      |         ^~~~
      |         short
Language: C++

#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#include<queue>
#include<map>
using namespace std;
 
typedef long long ll;

int n,m,l;
int q;


void dfs(int p,int oil,set<int> &cango,vector<vector<pair<int,int> > > &graph){
	return -1;
	for(int i=0;i<graph[p].size();++i){
		int next = graph[p][i].first;
		int cost = graph[p][i].second;
		if(cost <= oil && cango.find(next) == cango.end()){
			cango.insert(next);
			dfs(next,oil-cost,cango,graph);
		}
	}
}

int candfs(set<int> &res,vector<set<int> > &cango,int g){
	int resnum = -1;
	set<int> before_res;
	while(before_res.size() != res.size() && res.find(g) == res.end()){
		before_res = res;
		set<int> next_res;
		resnum++;
//		cout << "  "<<resnum << " " << res.size() <<endl;
		for(int re : res){
			for(int cang : cango[re]){
				if(res.find(cang)==res.end()){
					next_res.insert(cang);
				}
			}
		}
		for(int next : next_res) res.insert(next);
//		cout << before_res.size() << "  " << res.size() << " " <<( res.find(g)== res.end() )<<endl;
	}
	if(res.find(g) == res.end()) resnum = -1;
	return resnum;
}

int main(){
	cin >> n >> m >> l;
	vector<vector<pair<int,int> > > graph(n);
	vector<set<int> > cango(n);
	
	for(int i=0;i<m;++i){
		int a,b,c;
		cin >> a >> b >> c;
		a--;b--;
		graph[a].push_back(pair<int,int>(b,c));
		graph[b].push_back(pair<int,int>(a,c));
	}
	
	for(int i=0;i<n;++i){
		dfs(i,l,cango[i],graph);
	}
	cin  >> q;
	int s,g;
	for(int i=0;i<q;++i){
		//cout << "--" <<endl;
		cin >> s >> g;
		s--;g--;
		set<int> res;
		res.insert(s);
		cout << candfs(res,cango,g) <<endl;
	}
	/*
	cout << "-- out put --" <<endl;
	for(int i=0;i<n;++i){
		cout << i << endl;
		for(int cn : cango[i]){
			cout << " " << cn;
		}cout <<endl;
	}*/
	
	
	return 0;
}



Compiler output:
a.cc: In function 'void dfs(int, int, std::set<int>&, std::vector<std::vector<std::pair<int, int> > >&)':
a.cc:18:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   18 |         return -1;
      |                ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll=long long;

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

    vector<vector<ll>> G(n,vector<ll>(n,INT64_MAX/3));
    for (int i = 0; i < m; ++i) {
        llt a,b,c;
        cin>>a>>b>>c;
        --a;--b;
        if(c>l)continue;
        G[a][b]=c;
        G[b][a]=c;
    }
    for (int i = 0; i < n; ++i) {
        G[i][i]=0;
    }
    for (int k = 0; k < n; ++k) {
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                G[i][j]=min(G[i][j],G[i][k]+G[k][j]);
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            if(G[i][j]<=l)G[i][j]=1;
            else G[i][j]=INT32_MAX/3;
        }
    }
    for (int i = 0; i < n; ++i) {
        G[i][i]=0;
    }
    for (int k = 0; k < n; ++k) {
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                G[i][j]=min(G[i][j],G[i][k]+G[k][j]);
            }
        }
    }
    int q;
    cin>>q;
    for (int i = 0; i < q; ++i) {
        int s,t;
        cin>>s>>t;
        --s;--t;
        if(G[s][t]!=INT32_MAX/3)cout<<G[s][t]-1<<"\n";
        else cout<<"-1\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'llt' was not declared in this scope; did you mean 'll'?
   12 |         llt a,b,c;
      |         ^~~
      |         ll
a.cc:13:14: error: 'a' was not declared in this scope
   13 |         cin>>a>>b>>c;
      |              ^
a.cc:13:17: error: 'b' was not declared in this scope
   13 |         cin>>a>>b>>c;
      |                 ^
a.cc:13:20: error: 'c' was not declared in this scope
   13 |         cin>>a>>b>>c;
      |                    ^
Language: C++

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

const int MAX_N = 350, INF = (int)1e9;

int d[MAX_N][MAX_N];


int main() {
	int n, m, l; cin >> n >> m >> l;
	memset(d, INF, sizeof(d));
	for (int i = 0; i < m; i++) {
		int a, b, c; cin >> a >> b >> c;
		a--; b--;
		d[a][b] = d[b][a] = c;
	}

	for (int k = 0; k < m; k++) {
		for (int i = 0; i < m; i++) {
			for (int j = 0; j < m; j++) {
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
	for (int i = 0; i < m; i++) {
		for (int j = 0; j < m; j++) {
			d[i][j] = (d[i][j] <= l ? 1 : INF);
		}
	}
	for (int k = 0; k < m; k++) {
		for (int i = 0; i < m; i++) {
			for (int j = 0; j < m; j++) {
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}

	int q; cin >> q;
	for (int i = 0; i < q; i++) {
		int s, t; cin >> s >> t;
		s--; t--;
		cout << (d[s][t] == INF ? -1 : d[s][t] - 1) << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'memset' was not declared in this scope
   13 |         memset(d, INF, sizeof(d));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<vector>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<unordered_map>

using namespace std;

#define MOD 1000000007
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
typedef pair<ll, ll> P;
const long long INF = 1LL << 60;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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;
}

//グラフ関連
struct Edge {//グラフ
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}


void Dijkstra(Graph& G, ll s, Array& d,Array &u,ll l) {//O(|E|log|V|)
	d.resize(G.size());
	u.resize(G.size());
	REP(i, d.size())d[i] = l;
	REP(i, u.size())u[i] = INF;
	d[s] = 0;
	u[s] = 0;
	priority_queue<pair<pair<ll,ll>,ll>,vector<pair<pair<ll,ll>,ll>>,greater<pair<pair<ll,ll>,ll>>> q;

	q.push(make_pair(make_pair(0,0), s));
	while (!q.empty()) {
		ll k = q.top().first.first;
		ll dd = q.top().first.second;
		ll v = q.top().second;
		//cout << k << dd << v<<endl;
		q.pop();
		if (u[v] < k)continue;
      if(d[v]>dd)continue;

		REP(i, G[v].size()) {
          if(e.cap>l)continue;
			Edge e = G[v][i];
			ll nd = dd + e.cap;
			ll nk = k;
			if (nd > l ) {
				nd = e.cap;
				nk++;
			}
			if (u[e.to] > nk) {
				u[e.to] = nk;
				d[e.to] = nd;
				q.push(make_pair(make_pair(nk,nd), e.to));
				//cout << "aa" << nk << nd << e.to<<endl;
			}
			else if (u[e.to] == nk && d[e.to] > nd) {
				d[e.to] = nd;
				q.push(make_pair(make_pair(nk, nd), e.to));
				//cout << "bb" << nk << nd << e.to << endl;
			}
		}
	}
}

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

	ll n,m,l;
	cin >> n >> m >> l;
	Graph g(n);
	REP(i, m) {
		ll a, b, c;
		cin >> a >> b>>c;
		a--; b--;
		add_edge(g, a, b, c, true, c);
	}

	Matrix ans(n);
	Matrix d(n);

	REP(i, n) {
		Dijkstra(g, i, d[i], ans[i], l);
	}
	/*
	for (auto i : ans) {
		for (auto j : i) {
			cout << j << " ";
		}
		cout << endl;
	}
	*/
	
	ll q;
	cin >> q;

	REP(i, q) {
		ll s, t;
		cin >> s >> t;
		s--; t--;
		if (ans[s][t] != INF) {
			cout << ans[s][t] << endl;
		}
		else {
			cout << -1 << endl;
		}
	}




	return 0;
}


Compiler output:
a.cc: In function 'void Dijkstra(Graph&, long long int, Array&, Array&, long long int)':
a.cc:81:14: error: 'e' was not declared in this scope
   81 |           if(e.cap>l)continue;
      |              ^
Language: C++

#include<bits/stdc++.h>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
#define MOD


ll N,M,L,Q,S[101010],T[101010];
vector<pll> abcv[333];
vector<ll> exv[333];
ll mk[333];

ll i,j,k;
void bfs(ll s){
    
    ll i,j=0;
    fornum(i,0,N){
        mk[i+1]=-1;
    }
    mk[s]=L;
    
    while(true){
        pll a={-1,-1};
        fornum(i,0,N){
            if(mk[i+1]>0&&a.first<mk[i+1]){
                a={mk[i+1],i+1};
            }
        }
        if(a.first==-1)
            break;
        exv[s].push_back(qa.second);
        fornum(i,0,abcv[a].size()){
            pll b=abcv[a][i];
            if(mk[b.first]==-2)
                continue;
            mk[b.first]=max(mk[b.first],mk[a.second]-b.second);            
        }
        mk[a.second]=-2;
    }
}
void solve(ll s,ll t){
    //printf("aa");
    ll i,j;
    queue<pll> q;
    fornum(i,0,N){
        mk[i+1]=0;
    }
    q.push({s,0});
    mk[s]=1;
    while(q.size()){
        auto qa=q.front();
        //printf("a%llda",qa.first);
        q.pop();
        //printf("%lld ",qa.first);
        
        fornum(i,0,exv[qa.first].size()){
            ll b=exv[qa.first][i];
            if(!mk[b]){
                if(b==t){
                    printf("%lld\n",qa.second);
                    return;
                }
                mk[b]=1;
                q.push({b,qa.second+1});
            }
        }
    }
    printf("-1\n");
}

int main(){
    scanf("%lld%lld%lld", &N,&M,&L);
    fornum(i,0,M){
        ll a,b,c;
        scanf("%lld%lld%lld",&a,&b,&c);
        if(c>L)
            continue;
        abcv[a].push_back({b,c});
        abcv[b].push_back({a,c});
    }
    fornum(i,0,N){
        
        bfs(i+1);
        
    }
    scanf("%lld",&Q);
    fornum(i,0,Q){
        scanf("%lld%lld",&S[i],&T[i]);
    }
    fornum(i,0,Q){
        solve(S[i],T[i]);
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'void bfs(long long int)':
a.cc:38:26: error: 'qa' was not declared in this scope; did you mean 'a'?
   38 |         exv[s].push_back(qa.second);
      |                          ^~
      |                          a
a.cc:39:24: error: no match for 'operator[]' (operand types are 'std::vector<std::pair<long long int, long long int> > [333]' and 'std::pair<long long int, long long int>')
   39 |         fornum(i,0,abcv[a].size()){
      |                        ^
a.cc:4:33: note: in definition of macro 'fornum'
    4 | #define fornum(A,B,C) for(A=B;A<C;A++)
      |                                 ^
a.cc:40:23: error: no match for 'operator[]' (operand types are 'std::vector<std::pair<long long int, long long int> > [333]' and 'std::pair<long long int, long long int>')
   40 |             pll b=abcv[a][i];
      |                       ^
Language: C++

#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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; }
int n,m,l;

typedef struct Edge {
    ll to, cost;
} Edge;

vector<vector<Edge>> g;

struct Info {
    ll dist,lt, ans;
    Info(){}
    Info(ll dist,ll lt, ll ans):dist(dist),lt(lt),ans(ans){}
};

typedef tuple<ll,ll,ll> T;

void dijkstra(vector<Info> &dp, int s) {
    priority_queue<P> pq;
    dp[s].dist = 0;
    dp[s].lt = l;
    dp[s].ans = 0;
    // P(dist, v)
    pq.push({0,s});

    while (!pq.empty()) {
        P p = pq.top(); pq.pop();
        int v = p.second;
        for (auto &&e: g[v]) {
            if (dp[e.to].dist > dp[v].dist+e.cost) {
                dp[e.to].dist = dp[v].dist+e.cost;
                if (dp[v].lt - e.cost < 0) {
                    dp[v].lt = l;
                    chmin(dp[e.to].ans,1+dp[v].ans);
                }
                else {
                    dp[e.to].ans = dp[v].ans;
                }
                dp[e.to].lt = dp[v].lt-e.cost;
                dp[e.to].from = v;
                pq.push({dp[e.to].dist, e.to});
            }
        }
    }
}

int main(int argc, char const *argv[]) {
    cin>>n>>m>>l;
    g.resize(n);
    rep(i,m) {
        ll a,b,c; cin>>a>>b>>c;
        --a,--b;
        if (l < c) continue;
        g[a].push_back({b,c});
        g[b].push_back({a,c});
    }

    int q; cin>>q;
    map<int, vector<P>> b;
    rep(i,q) {
        int s,t; cin>>s>>t; --s,--t;
        b[min(s,t)].emplace_back(i,max(s,t));
    }

    vector<int> c(q);

    for (auto &&e: b) {
        Info init;
        init.dist=LINF;
        init.lt=0;
        init.ans=LINF;
        vector<Info> dp(n,init);
        dijkstra(dp,e.first);
        for (auto &&w: e.second) {
            if (dp[w.second].dist == LINF) c[w.first] = -1;
            else c[w.first] = dp[w.second].ans;
        }
    }

    rep(i,q) {
        cout << c[i] << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'void dijkstra(std::vector<Info>&, int)':
a.cc:75:26: error: '__gnu_cxx::__alloc_traits<std::allocator<Info>, Info>::value_type' {aka 'struct Info'} has no member named 'from'
   75 |                 dp[e.to].from = v;
      |                          ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define SUM(a)  accumulate((a).begin(),(a).end(),0)
#define SORT(a) sort(ALL(a))
#define REV(a) reverse(ALL(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
typedef long long ll;
const int INTINF = 1<<29;
const ll LLINF = 1LL<<61;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int DX[8]={ 0, 1, 0,-1, 1, 1,-1,-1};
const int DY[8]={ 1, 0,-1, 0, 1,-1, 1,-1};

ll d[300][300];

void warshall_floyd(int n) {
  for (int k = 0; k < n; k++){       // 経由する頂点
    for (int i = 0; i < n; i++) {    // 始点
      for (int j = 0; j < n; j++) {  // 終点
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
    }
  }
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,m,l;
  cin >> n >> m >> l;
  int a,b;
  ll c;
  REP(i,n)REP(j,n){
    if(i==j)d[i][j]=0;
    else d[i][j] = LLINF;
  }
  int a,b;
  ll c;
  REP(i,m){
    cin >> a >> b >> c;
    d[a-1][b-1] = c;
    d[b-1][a-1] = c;
  }

  warshall_floyd(n);

  int q;
  cin >> q;
  REP(i,n)REP(j,n){
    if (i==j)continue;
    if (d[i][j] <= l)d[i][j] = 1;
  }
  warshall_floyd(n);
  int s,t;
  REP(i,q){
    cin >> s >> t;
    if (d[s-1][t-1]==LLINF)cout <<-1<<endl;
    else cout << d[s-1][t-1]-1 << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:7: error: redeclaration of 'int a'
   41 |   int a,b;
      |       ^
a.cc:35:7: note: 'int a' previously declared here
   35 |   int a,b;
      |       ^
a.cc:41:9: error: redeclaration of 'int b'
   41 |   int a,b;
      |         ^
a.cc:35:9: note: 'int b' previously declared here
   35 |   int a,b;
      |         ^
a.cc:42:6: error: redeclaration of 'll c'
   42 |   ll c;
      |      ^
a.cc:36:6: note: 'll c' previously declared here
   36 |   ll c;
      |      ^
Language: C++

#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long
using namespace std;
using vl=vector<ll>;
int n,m;
vector<vl> g,d;
ll mx=(ll)1e18+11;
void solve(){
  d=vector<vl>(n+1,vl(n+1,mx));
  for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++){
      d[i][j]=d[j][i]=g[i][j];
    }
  for(int k=1;k<=n;k++){
    for(int i=1;i<=n;i++){
      for(int j=1;j<=n;j++){
        if((d[i][k]+d[k][j])<d[i][j])
          d[i][j]=(d[i][k]+d[k][j]);
      }
    }
  }
}
int main(){
  fast;
  int a,b,q,l,c;
  cin>>n>>m>>l;
  g=vector<vl>(n+1,vl(n+1,mx));
  for(int i=0;i<m;i++){
    cin>>a>>b>>c;
    g[a][b]=g[b][a]=c;
  }
  solve();
  cin>>q;
  for(int i=0;i<q;i++){
    ll s,t;
    cin>>s>>t;
    if(d[s][t]==mx) cout<<-1<<"\n";
    else if(x<=l) cout<<0<<"\n";
    else cout<<(ceil((float)d[s][t]/(float)l)<<"\n";
  }
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:13: error: 'x' was not declared in this scope
   39 |     else if(x<=l) cout<<0<<"\n";
      |             ^
a.cc:40:46: error: invalid operands of types 'float' and 'const char [2]' to binary 'operator<<'
   40 |     else cout<<(ceil((float)d[s][t]/(float)l)<<"\n";
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
      |                     |                          |
      |                     float                      const char [2]
a.cc:40:52: error: expected ')' before ';' token
   40 |     else cout<<(ceil((float)d[s][t]/(float)l)<<"\n";
      |                ~                                   ^
      |                                                    )