Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
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;
		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;
		newdist list[n+1];
		for(ll i=1; i<=n ; i++)
			{
				prqueue.insert(mp(src[dij][i],i));
				src[dij][i];
			}	

		while(!prqueue.empty())
		{
			pair<newdist,ll> lat = *(prqueue.begin());
			prqueue.erase(lat);
			for(auto e: edge[lat.ss])
			{
				if(weight[e][lat.ss] > lat.ff.cur)
				{
					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<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 >=1e9)
	 	cout<<-1<<endl;
	 else
	 	cout<<ref<<endl;
	}





	

	return 0;
}

Compiler output:
a.cc:9:1: error: 'll' does not name a type
    9 | ll refills;
      | ^~
a.cc:10:1: error: 'll' does not name a type
   10 | ll cur;
      | ^~
a.cc: In member function 'bool newdist::operator<(newdist) const':
a.cc:16:12: error: 'refills' was not declared in this scope; did you mean 'ceill'?
   16 |         if(refills<b.refills)
      |            ^~~~~~~
      |            ceill
a.cc:16:22: error: 'const class newdist' has no member named 'refills'
   16 |         if(refills<b.refills)
      |                      ^~~~~~~
a.cc:18:30: error: 'const class newdist' has no member named 'refills'
   18 |         else if(refills == b.refills)
      |                              ^~~~~~~
a.cc:20:20: error: 'cur' was not declared in this scope
   20 |                 if(cur<b.cur)
      |                    ^~~
a.cc:20:26: error: 'const class newdist' has no member named 'cur'
   20 |                 if(cur<b.cur)
      |                          ^~~
a.cc: In function 'int main()':
a.cc:37:9: error: 'll' was not declared in this scope
   37 |         ll n,m,cap,u,v,c;
      |         ^~
a.cc:38:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   38 |         cin>>n>>m>>cap;
      |              ^
      |              yn
a.cc:38:17: error: 'm' was not declared in this scope; did you mean 'tm'?
   38 |         cin>>n>>m>>cap;
      |                 ^
      |                 tm
a.cc:38:20: error: 'cap' was not declared in this scope
   38 |         cin>>n>>m>>cap;
      |                    ^~~
a.cc:39:18: error: template argument 2 is invalid
   39 |         vector<ll> edge[n+1];
      |                  ^
a.cc:40:11: error: expected ';' before 'weight'
   40 |         ll weight[n+1][n+1]={};
      |           ^~~~~~~
      |           ;
a.cc:44:15: error: expected ';' before 'i'
   44 |         for(ll i=0 ; i<m ; i++)
      |               ^~
      |               ;
a.cc:44:22: error: 'i' was not declared in this scope
   44 |         for(ll i=0 ; i<m ; i++)
      |                      ^
a.cc:46:22: error: 'u' was not declared in this scope
   46 |                 cin>>u>>v>>c;
      |                      ^
a.cc:46:25: error: 'v' was not declared in this scope
   46 |                 cin>>u>>v>>c;
      |                         ^
a.cc:46:28: error: 'c' was not declared in this scope
   46 |                 cin>>u>>v>>c;
      |                            ^
a.cc:47:17: error: 'edge' was not declared in this scope
   47 |                 edge[u].pb(v);
      |                 ^~~~
a.cc:49:17: error: 'weight' was not declared in this scope
   49 |                 weight[u][v] = c;
      |                 ^~~~~~
a.cc:52:15: error: expected ';' before 'i'
   52 |         for(ll i = 1; i<=n ; i++)
      |               ^~
      |               ;
a.cc:52:23: error: 'i' was not declared in this scope
   52 |         for(ll i = 1; i<=n ; i++)
      |                       ^
a.cc:54:23: error: expected ';' before 'j'
   54 |                 for(ll j = 1; j<=n ; j++)
      |                       ^~
      |                       ;
a.cc:54:31: error: 'j' was not declared in this scope; did you mean 'jn'?
   54 |                 for(ll j = 1; j<=n ; j++)
      |                               ^
      |                               jn
a.cc:57:25: error: 'src' was not declared in this scope
   57 |                         src[i][j].refills = 1e9;
      |                         ^~~
a.cc:62:15: error: expected ';' before 'dij'
   62 |         for(ll dij = 1; dij<=n ; dij++)
      |               ^~~~
      |               ;
a.cc:62:25: error: 'dij' was not declared in this scope; did you mean 'div'?
   62 |         for(ll dij = 1; dij<=n ; dij++)
      |                         ^~~
      |                         div
a.cc:64:17: error: 'src' was not declared in this scope
   64 |                 src[dij][dij].refills = 0;
      |                 ^~~
a.cc:66:37: error: template argument 1 is invalid
   66 |                 set <pair<newdist,ll>> prqueue;
      |                                     ^~
a.cc:66:37: error: template argument 2 is invalid
a.cc:66:37: error: template argument 3 is invalid
a.cc:68:23: error: expected ';' before 'i'
   68 |                 for(ll i=1; i<=n ; i++)
      |                       ^~
      |                       ;
a.cc:68:29: error: 'i' was not declared in this scope
   68 |                 for(ll i=1; i<=n ; i++)
      |                             ^
a.cc:70:41: error: request for member 'insert' in 'prqueue', which is of non-class type 'int'
   70 |                                 prqueue.insert(mp(src[dij][i],i));
      |                                         ^~~~~~
a.cc:74:32: error: request for member 'empty' in 'prqueue', which is of non-class type 'int'
   74 |                 while(!prqueue.empty())
      |                                ^~~~~
a.cc:76:58: error: request for member 'begin' in 'prqueue', which is of non-class type 'int'
   76 |                         pair<newdist,ll> lat = *(prqueue.begin());
      |                                                          ^~~~~
a.cc:77:33: error: request for member 'erase' in 'prqueue', which is of non-class type 'int'
   77 |                         prqueue.erase(lat);
      |                                 ^~~~~
a.cc:78:37: error: 'edge' was not declared in this scope
   78 |                         for(auto e: edge[lat.ss])
      |                                     ^~~~
a.cc:6:12: error: request for member 'second' in 'lat', which is of non-class type 'int'
    6 | #define ss second
      |            ^~~~~~
a.cc:78:46: note: in expansion of macro 'ss'
   78 |                         for(auto e: edge[lat.ss])
      |                                              ^~
a.cc:80:36: error: 'weight' was not declared in this scope
   80 |                                 if(weight[e][lat.ss] > lat.ff.cur)
      |                                    ^~~~~~
a.cc:6:12: error: request for member 'second' in 'lat', which is of non-class type 'int'
    6 | #define ss second
      |            ^~~~~~
a.cc:80:50: note: in expansion of macro 'ss'
   80 |                                 if(weight[e][lat.ss] > lat.ff.cur)
      |                                                  ^~
a.cc:5:12: error: request for member 'first' in 'lat', which is of non-class type 'int'
    5 | #define ff first
      |            ^~~~~
a.cc:80:60: note: in expansion of macro 'ff'
   80 |                                 if(weight[e][lat.ss] > lat.ff.cur)
      |                                                            ^~
a.cc:83:45: error: 'class newdist' has no member named 'refills'
   83 |                                         upd.refills = lat.ff.refills+1;
      |                                             ^~~~~~~
a.cc:5:12: error: request for member 'first' in 'lat', which is of non-class type 'int'
    5 | #define ff first
      |            ^~~~~
a.cc:83:59: note: in expansion of macro 'ff'
   83 |                                         upd.refills = lat.ff.refills+1;
      |                                                           ^~
a.cc:84:45: error: 'class newdist' has no member named 'cur'
   84 |                                         upd.cur = cap - weight[e][lat.ss];
      |                                             ^~~
a.cc:6:12: error: request for member 'second' in 'lat', which is of non-class type 'int'
    6 | #define ss second
      |            ^~~~~~
a.cc:84:71: note: in expansion of macro 'ss'
   84 |                                         upd.cur = cap - weight[e][lat.ss];
      |                                                                       ^~
a.cc:87:65: error: request for member 'erase' in 'prqueue', which is of non-class type 'int'
   87 |                                                         prqueue.erase(mp(src[dij][e],e));
      |                                                                 ^~~~~
a.cc:89:65: error: request for member 'insert' in 'prqueue', which is of non-class type 'int'
   89 |                                                         prqueue.insert(mp(src[dij][e],e));
      |                                                                 ^~~~~~
a.cc:95:45: error: 'class newdist' has no member named 'refills'
   95 |                                         upd.refills = lat.ff.refills;
      |                                             ^~~~~~~
a.cc:5:12: error: request for member 'first' in 'lat', which is of non-class type 'int'
    5 | #define ff first
      |            ^~~~~
a.cc:95:59: note: in expansion of macro 'ff'
   95 |                                         upd.refills = lat.ff.refills;
      |                                                           ^~
a.cc:96:45: error: 'class newdist' has no member named 'cur'
   96 |                                         upd.cur = lat.ff.cur - weight[e][lat.ss];
      |                                             ^~~
a.cc:5:12: error: request for member 'first' in 'lat', which is of non-class type 'int'
    5 | #define ff first
      |            ^~~~~
a.cc:96:55: note: in expansion of macro 'ff'
   96 |                                         upd.cur = lat.ff.cur - weight[e][lat.ss];
      |                                                       ^~
a.cc:6:12: error: request for member 'second' in 'lat', which is of non-class type 'int'
    6 | #define ss second
      |            ^~~~~~
a.cc:96:78: note: in expansion of macro 'ss'
   96 |                                         upd.cur = lat.ff.cur - weight[e][lat.ss];
      |                                                                              ^~
a.cc:99:65: error: request for member 'erase' in 'prqueue', which is of non-class type 'int'
   99 |                                                         prqueue.erase(mp(src[dij][e],e));
      |                                                                 ^~~~~
a.cc:101:65: error: request for member 'insert' in 'prqueue', which is of non-class type 'int'
  101 |                                                         prqueue.insert(mp(src[dij][e],e));
      |                                                                 ^~~~~~
a.cc:110:11: error: ex