Language: C++

struct Node {
	// このノードから伸びるエッジの情報
	vector<int> edges_to;    // 各エッジの接続先のノード番号
	vector<LL> edges_cost;  // 各エッジのコスト

	// ダイクストラ法のためのデータ
	bool done;  // 確定ノードか否か
	LL cost;   // このノードへの現時点で判明している最小コスト

	Node(){
		edges_to.clear();
		edges_cost.clear();
		done=false;
		cost=-1;
	}
};

LL GetDijkstraDist(int N,const vector<int> &v1,const vector<int> &v2,const vector<LL> &cost,int nodeI,int nodeJ)
{
	if (nodeI>nodeJ){
		swap(nodeI,nodeJ);
	}
	//開始頂点は0から
	const int E=(int)v1.size();
	vector<Node> Nodes(N);
	int i;
	for (i=0;i<E;i++){
		Nodes[v1[i]-1].edges_to.push_back(v2[i]);
		Nodes[v1[i]-1].edges_cost.push_back(cost[i]);
	}
	set<Node*> Set;
	Node *startNode = &(Nodes[nodeI]);
	startNode->cost=0;// スタートノードのコストは0
	Set.insert(startNode);
	set<Node*>::iterator sit;
	while (!Set.empty()){
		sit=Set.begin();
		Node *doneNode=(*sit);
		Set.erase(sit);
		if (!doneNode->done){
			doneNode->done=true;
			for (i=0;i<doneNode->edges_to.size();i++){
				int to=doneNode->edges_to[i];
				LL cost=doneNode->cost+doneNode->edges_cost[i];
				if (Nodes[to-1].cost<0 || cost<Nodes[to-1].cost){
					Nodes[to-1].cost=cost;
				}
				Set.insert(&(Nodes[to-1]));
			}
		}
	}
	LL Nums=Nodes[nodeJ].cost;
	Nodes.clear();
	return Nums;
}

int main(int argc, char* argv[])
{
	int N,M,Q;
	LL L;
	cin>>N>>M>>L;
	if (M==0){
		cout<<-1<<endl;
		return 0;
	}
	vector<int> v1(M),v2(M);
	vector<LL> cost(M);
	int i;
	for (i=0;i<M;i++){ 
		cin>>v1[i]>>v2[i]>>cost[i];
	}
	cin>>Q;
	vector<LL> s(Q),t(Q);
	int S,T;
	for (i=0;i<Q;i++){
		LL ans=0;
		LL SumL=L;
		cin>>S>>T;
		LL c=GetDijkstraDist(N,v1,v2,cost,S-1,T-1);
		while (SumL<c){
			SumL+=L;
			ans++;
		}
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc:3:9: error: 'vector' does not name a type
    3 |         vector<int> edges_to;    // 各エッジの接続先のノード番号
      |         ^~~~~~
a.cc:4:9: error: 'vector' does not name a type
    4 |         vector<LL> edges_cost;  // 各エッジのコスト
      |         ^~~~~~
a.cc:8:9: error: 'LL' does not name a type
    8 |         LL cost;   // このノードへの現時点で判明している最小コスト
      |         ^~
a.cc: In constructor 'Node::Node()':
a.cc:11:17: error: 'edges_to' was not declared in this scope
   11 |                 edges_to.clear();
      |                 ^~~~~~~~
a.cc:12:17: error: 'edges_cost' was not declared in this scope
   12 |                 edges_cost.clear();
      |                 ^~~~~~~~~~
a.cc:14:17: error: 'cost' was not declared in this scope; did you mean 'const'?
   14 |                 cost=-1;
      |                 ^~~~
      |                 const
a.cc: At global scope:
a.cc:18:1: error: 'LL' does not name a type
   18 | LL GetDijkstraDist(int N,const vector<int> &v1,const vector<int> &v2,const vector<LL> &cost,int nodeI,int nodeJ)
      | ^~
a.cc: In function 'int main(int, char**)':
a.cc:60:9: error: 'LL' was not declared in this scope
   60 |         LL L;
      |         ^~
a.cc:61:9: error: 'cin' was not declared in this scope
   61 |         cin>>N>>M>>L;
      |         ^~~
a.cc:61:20: error: 'L' was not declared in this scope
   61 |         cin>>N>>M>>L;
      |                    ^
a.cc:63:17: error: 'cout' was not declared in this scope
   63 |                 cout<<-1<<endl;
      |                 ^~~~
a.cc:63:27: error: 'endl' was not declared in this scope
   63 |                 cout<<-1<<endl;
      |                           ^~~~
a.cc:66:9: error: 'vector' was not declared in this scope
   66 |         vector<int> v1(M),v2(M);
      |         ^~~~~~
a.cc:66:16: error: expected primary-expression before 'int'
   66 |         vector<int> v1(M),v2(M);
      |                ^~~
a.cc:67:20: error: 'cost' was not declared in this scope; did you mean 'const'?
   67 |         vector<LL> cost(M);
      |                    ^~~~
      |                    const
a.cc:70:22: error: 'v1' was not declared in this scope
   70 |                 cin>>v1[i]>>v2[i]>>cost[i];
      |                      ^~
a.cc:70:29: error: 'v2' was not declared in this scope
   70 |                 cin>>v1[i]>>v2[i]>>cost[i];
      |                             ^~
a.cc:73:20: error: 's' was not declared in this scope
   73 |         vector<LL> s(Q),t(Q);
      |                    ^
a.cc:73:25: error: 't' was not declared in this scope
   73 |         vector<LL> s(Q),t(Q);
      |                         ^
a.cc:76:19: error: expected ';' before 'ans'
   76 |                 LL ans=0;
      |                   ^~~~
      |                   ;
a.cc:77:19: error: expected ';' before 'SumL'
   77 |                 LL SumL=L;
      |                   ^~~~~
      |                   ;
a.cc:79:19: error: expected ';' before 'c'
   79 |                 LL c=GetDijkstraDist(N,v1,v2,cost,S-1,T-1);
      |                   ^~
      |                   ;
a.cc:80:24: error: 'SumL' was not declared in this scope
   80 |                 while (SumL<c){
      |                        ^~~~
a.cc:80:29: error: 'c' was not declared in this scope
   80 |                 while (SumL<c){
      |                             ^
a.cc:82:25: error: 'ans' was not declared in this scope
   82 |                         ans++;
      |                         ^~~
a.cc:84:17: error: 'cout' was not declared in this scope
   84 |                 cout<<ans<<endl;
      |                 ^~~~
a.cc:84:23: error: 'ans' was not declared in this scope
   84 |                 cout<<ans<<endl;
      |                       ^~~
a.cc:84:28: error: 'endl' was not declared in this scope
   84 |                 cout<<ans<<endl;
      |                            ^~~~