Language: C++

#include<cstdio>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define mp make_pair
const int INF=1001001001;
int N,M,X;
int H[100002];
vector< pair<int,long long int> > graph[100002];
long long int memo[100002];//djkstraメモ


int main(){
	//FILE *fp;
	//fp=fopen("C:\\Users\\ray\\Desktop\\1JOI本選\\2014\\joi2014-ho-data\\joi2014-ho-data\\2014-ho-t4\\in\\03-14.txt","r");
	scanf("%d %d %d",&N,&M,&X);
	rep(i,N){scanf("%d",&H[i]);memo[i]=-1;};
	rep(i,M){
		int to,from,cost;
		scanf("%d %d %d",&to,&from,&cost);
		graph[from-1].push_back(make_pair(to-1,cost));
		graph[to-1].push_back(make_pair(from-1,cost));
	}
	
	//Djkstra
	queue< pair<int,long long int>　> q1;//木の番号、到達コスト.木の上での位置はX-コストか0
	q1.push(mp(0,0));
	long long int ans=-1;
	do{
		pair<int,long long int> a =q1.front();
		q1.pop();
		queue<　pair<int,long long int>　> q2;
		rep(i,graph[a.first].size()){
			long long int ncost=-1;
			if(max(X-a.second,(long long int)(0))-graph[a.first][i].second>H[graph[a.first][i].first]){
			//移動先>木の高さ    下がってから飛ぶ
				ncost=a.second+max(X-a.second,(long long int)(0))-H[graph[a.first][i].first];
			
			}else if(max(X-a.second,(long long int)(0))-graph[a.first][i].second>=0){
			//0<=移動先<=木の高さ   そのまま飛ぶ
				ncost=a.second+graph[a.first][i].second;
			}else{
			//0>移動先   上がってから飛ぶ
				if(H[a.first]<graph[a.first][i].second)continue;
				ncost=a.second+graph[a.first][i].second-max(X-a.second,(long long int)(0))+graph[a.first][i].second;
			}
			if(memo[graph[a.first][i].first]<0||memo[graph[a.first][i].first]>ncost){
				memo[graph[a.first][i].first]=ncost;
				if(graph[a.first][i].first!=N-1)q2.push(mp(graph[a.first][i].first,ncost));
			}

		}
		if(q1.empty())q1=q2;
	}while(!q1.empty());

	printf("%lld",memo[N-1]+(memo[N-1]!=-1)*H[N-1]);
}

Compiler output:
a.cc:30:39: error: extended character 　 is not valid in an identifier
   30 |         queue< pair<int,long long int>　> q1;//木の番号、到達コスト.木の上での位置はX-コストか0
      |                                       ^
a.cc:36:23: error: extended character 　 is not valid in an identifier
   36 |                 queue<　pair<int,long long int>　> q2;
      |                       ^
a.cc:36:48: error: extended character 　 is not valid in an identifier
   36 |                 queue<　pair<int,long long int>　> q2;
      |                                                ^
a.cc: In function 'int main()':
a.cc:30:41: error: template argument 1 is invalid
   30 |         queue< pair<int,long long int>　> q1;//木の番号、到達コスト.木の上での位置はX-コストか0
      |                                         ^
a.cc:30:41: error: template argument 2 is invalid
a.cc:31:12: error: request for member 'push' in 'q1', which is of non-class type 'int'
   31 |         q1.push(mp(0,0));
      |            ^~~~
a.cc:34:47: error: request for member 'front' in 'q1', which is of non-class type 'int'
   34 |                 pair<int,long long int> a =q1.front();
      |                                               ^~~~~
a.cc:35:20: error: request for member 'pop' in 'q1', which is of non-class type 'int'
   35 |                 q1.pop();
      |                    ^~~
a.cc:36:23: error: '\U00003000pair' was not declared in this scope
   36 |                 queue<　pair<int,long long int>　> q2;
      |                       ^~~~~~
a.cc:36:47: error: template argument 1 is invalid
   36 |                 queue<　pair<int,long long int>　> q2;
      |                                               ^
a.cc:36:47: error: template argument 2 is invalid
a.cc:36:50: error: expected initializer before '>' token
   36 |                 queue<　pair<int,long long int>　> q2;
      |                                                  ^
a.cc:53:65: error: 'q2' was not declared in this scope; did you mean 'q1'?
   53 |                                 if(graph[a.first][i].first!=N-1)q2.push(mp(graph[a.first][i].first,ncost));
      |                                                                 ^~
      |                                                                 q1
a.cc:57:23: error: request for member 'empty' in 'q1', which is of non-class type 'int'
   57 |                 if(q1.empty())q1=q2;
      |                       ^~~~~
a.cc:57:34: error: 'q2' was not declared in this scope; did you mean 'q1'?
   57 |                 if(q1.empty())q1=q2;
      |                                  ^~
      |                                  q1
a.cc:58:20: error: request for member 'empty' in 'q1', which is of non-class type 'int'
   58 |         }while(!q1.empty());
      |                    ^~~~~