Language: C++

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

typedef long long 		ll;
typedef vector<ll> 		vll;
typedef pair<ll,ll> 	pll;
typedef vector<pll> 	vpll;
typedef vector<int> 	vi;
typedef pair<int,int> 	pii;
typedef vector<pii> 	vpii;

#define fi				first
#define se 				second
#define pb 				push_back
#define mp 				make_pair
#define all(v)			v.begin(),v.end()
#define sz(v)			s.size()
#define rep(i,a,b) 		for(int i=a;i<=b;i++)
#define per(i,a,b) 		for(int i=a;i>=b;i--)
#define fill(a,v)		memset(a,v,sizeof(a))
#define tc				int T;cin>>T;while(T--)
#define nl				printf("\n")
#define aya				cerr<<"yaha aya"<<"\n"
#define debug(x,y)		printf("%d %d\n",x,y)
#define fast_io			ios_base::sync_with_stdio(false);cin.tie(NULL);
#define grt				greater<int>()

const int mod = 1e9+7;
const int mod2= 1e9+9;

inline int pow_(ll a, int n, int p=mod){
	int r=1;while(n){if(n&1)r=r*a%p;n>>=1;a=a*a%p;}return r;
}

const int MAX = 1e3+1;
const int LG = 30+1;
const int INF = 1e9;

int g[MAX][MAX];
ll d[MAX][MAX];
int refills[MAX][MAX];

int main(void)
{
	int n,m;
	ll l;
	cin>>n>>m>>l;
	rep(i,1,n) rep(j,1,n) d[i][j] = i==j ? 0 : INF;
	rep(i,1,m)
	{
		int u,v,w;cin>>u>>v>>w;
		g[u][v] = g[v][u] = w;
		d[u][v] = min(d[u][v], w);
		d[v][u] = min(d[v][u], w);		
	}


	rep(k,1,n)
		rep(i,1,n)
			rep(j,1,n)
			{
				// if(i == j) continue;
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}

	rep(i,1,n)
		rep(j,1,n){
			refills[i][j] = d[i][j] <= l ? 1 : INF;
			if(i == j)
				refills[i][j] = 0;
		}

	rep(k,1,n)
		rep(i,1,n)
			rep(j,1,n)
			{
				// if(i == j) continue;
				refills[i][j] = min(refills[i][j], refills[i][k] + refills[k][j]);
			}

	int q;cin>>q;
	while(q--)
	{
		int s,t;cin>>s>>t;
		int ans = refills[s][t];
		if (ans >= INF) ans = -1;
		else ans--;
		cout<<ans<<"\n";	
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:30: error: no matching function for call to 'min(ll&, int&)'
   53 |                 d[u][v] = min(d[u][v], w);
      |                           ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:53:30: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   53 |                 d[u][v] = min(d[u][v], w);
      |                           ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:53:30: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   53 |                 d[u][v] = min(d[u][v], w);
      |                           ~~~^~~~~~~~~~~~
a.cc:54:30: error: no matching function for call to 'min(ll&, int&)'
   54 |                 d[v][u] = min(d[v][u], w);
      |                           ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:54:30: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   54 |                 d[v][u] = min(d[v][u], w);
      |                           ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:54:30: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   54 |                 d[v][u] = min(d[v][u], w);
      |                           ~~~^~~~~~~~~~~~