Language: C++

#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
#define INF (1LL << 40)
using namespace std;
typedef long long ll;

ll N, M, S, T, D[100000], A, B;
vector<ll> E[100000];

int main(void) {
  cin >> N >> M >> S >> T; S--; T--;
  REP(i, 0, N) cin >> D[i];
  REP(i, 0, M) {
    cin >> A >> B; A--; B--;
    if(A < B) E[A].push_back(B);
    if(B < A) E[B].push_back(A);
  }

  vector<ll> dp(N, INF);
  priority_queue<state> q;
  q.push((state) { S, 0 });

  while(q.size()) {
    state c = q.top();
    q.pop();

    // cout << c.v << " " << c.d << endl;

    if(c.d >= dp[c.v]) continue;
    dp[c.v] = c.d;

    if(c.v == T) {
      cout << c.d << endl;
      return 0;
    }

    if(c.v - 1 >= 0 && dp[c.v - 1] > c.d) q.push((state) { c.v - 1, c.d });
    for(ll u : E[c.v]) if(dp[u] > c.d + D[u]) q.push((state) { u, c.d + D[u] });
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:18: error: 'state' was not declared in this scope; did you mean '_xstate'?
   20 |   priority_queue<state> q;
      |                  ^~~~~
      |                  _xstate
a.cc:20:23: error: template argument 1 is invalid
   20 |   priority_queue<state> q;
      |                       ^
a.cc:20:23: error: template argument 2 is invalid
a.cc:20:23: error: template argument 3 is invalid
a.cc:21:5: error: request for member 'push' in 'q', which is of non-class type 'int'
   21 |   q.push((state) { S, 0 });
      |     ^~~~
a.cc:21:17: error: expected ')' before '{' token
   21 |   q.push((state) { S, 0 });
      |         ~       ^~
      |                 )
a.cc:23:11: error: request for member 'size' in 'q', which is of non-class type 'int'
   23 |   while(q.size()) {
      |           ^~~~
a.cc:24:10: error: expected ';' before 'c'
   24 |     state c = q.top();
      |          ^~
      |          ;
a.cc:25:7: error: request for member 'pop' in 'q', which is of non-class type 'int'
   25 |     q.pop();
      |       ^~~
a.cc:29:8: error: 'c' was not declared in this scope
   29 |     if(c.d >= dp[c.v]) continue;
      |        ^
a.cc:30:8: error: 'c' was not declared in this scope
   30 |     dp[c.v] = c.d;
      |        ^
a.cc:37:45: error: request for member 'push' in 'q', which is of non-class type 'int'
   37 |     if(c.v - 1 >= 0 && dp[c.v - 1] > c.d) q.push((state) { c.v - 1, c.d });
      |                                             ^~~~
a.cc:37:57: error: expected ')' before '{' token
   37 |     if(c.v - 1 >= 0 && dp[c.v - 1] > c.d) q.push((state) { c.v - 1, c.d });
      |                                                 ~       ^~
      |                                                         )
a.cc:38:49: error: request for member 'push' in 'q', which is of non-class type 'int'
   38 |     for(ll u : E[c.v]) if(dp[u] > c.d + D[u]) q.push((state) { u, c.d + D[u] });
      |                                                 ^~~~
a.cc:38:61: error: expected ')' before '{' token
   38 |     for(ll u : E[c.v]) if(dp[u] > c.d + D[u]) q.push((state) { u, c.d + D[u] });
      |                                                     ~       ^~
      |                                                             )