Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) { a = max(a, b); }
template<typename T> void chmin(T &a, T b) { a = min(a, b); }
template<typename T> void chadd(T &a, T b) { a = a + b; }

typedef pair<int, int> pii;
typedef long long ll;

int dx[] = { 0, 0, 1, -1 };
int dy[] = { 1, -1, 0, 0 };
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

int N, M, K, S, P, Q, dist[100010], rec[100010];
bool used[100010];
// (from, to) and (to, cost)
vector<pii> es, H[100010];
vector<int> G[100010];

signed main() {
	cin >> N >> M >> K >> S >> P >> Q;
	rep(i, 0, N) dist[i] = rec[i] = INF;

	// cost, current
	priority_queue< pii, vector<pii>, greater<pii> > q;
	rep(i, 0, K) {//??????????????¶???
		int p; cin >> p; p--;
		dist[p] = 0; used[p] = true;//p??????????????§????\????????????????
		q.push(pii(0, p));
	}
	rep(i, 0, M) {//??????????????????
		int u, v; cin >> u >> v; u--; v--;
		G[u].push_back(v);//G???vector,??????
		G[v].push_back(u);
		es.push_back(pii(v, u));//priority_queue????????????
		es.push_back(pii(u, v));
	}
	while (!q.empty()) {
		pii t = q.top(); q.pop();//??????????????¶???
		int cost = t.first, cur = t.second;//cost??????????????????cur??????????????????????\??????????????????????
		for (auto to : G[cur]) {
			if (dist[to] > dist[cur] + 1) {//??±???????????????????????¢?????¬???
				dist[to] = dist[cur] + 1;//?¬????????????????????????±?????????
				q.push(pii(dist[to], to));//?????¢????¬????????????????push
			}
		}
	}
	rep(i, 0, 2 * M) {
		int u = es[i].first, v = es[i].second;//???
		int du = dist[u], dv = dist[v];//??????????????????????????¢?????£??\
		if (v == N - 1) H[u].push_back(pii(v, 0));//????????´???????????????????????????
		else {
			if (dv <= S) H[u].push_back(pii(v, Q));//??????????????????????????°?????????????????????
			else        H[u].push_back(pii(v, P));
		}
	}

	rec[0] = 0;//???????????°??????cost??????
	q.push(pii(0, 0));//?????\????????°??????????????????????????£??????
	while (!q.empty()) {
		pii t = q.top(); q.pop();//pair?????£??\
		int cost = t.first, cur = t.second;//??????????????°???
		for (auto e : H[cur]) {//e????????????????????????????????¨?????°???????????????????????´??????
			if (used[e.first]) continue;//???????????§????¨???£?????????????????°???????????§??????????????§??¢??????
	//		if (rec[e.first] > rec[cur] + e.second) {//?????????????????????????????????????????§????????£??????
				rec[e.first] = rec[cur] + e.second;//???????????£??\????????????????????£?????????
				q.push(pii(rec[e.first], e.first));//?¬????????????´?????????????????´???????????\????????????????????????????£????????????§????£??????????????????????
		//	}
		}
	}
	cout << rec[N - 1] << endl;//???????????\????????????????????¬??????
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:81:17: error: 'else' without a previous 'if'
   81 |                 else {
      |                 ^~~~
a.cc:92:33: error: 'cur' was not declared in this scope
   92 |                 for (auto e : H[cur]) {//e????????????????????????????????¨?????°???????????????????????´??????
      |                                 ^~~