Language: C++

#include<bits/stdc++.h>
#include<queue>
using namespace std;
vector<long long>di_s;
vector<long long>di_y;
int main () {
  int N, m, s, t;
  cin >> N >> m >> s >> t;
  vector<queue<int>>snu(N);
  vector<queue<int>>yen(N);
  vector<int>si(N, 0);
  vector<queue<long long>>cost_s(N);
  vector<queue<long long>>cost_y(N);
  for (int i = 0; i < m; i ++) {
    int u, v;
    long long a, b;
    cin >> u >> v >> a >> b;
    v --;
    u --;
    snu[u].push(v);
    snu[v].push(u);
    yen[u].push(v);
    yen[v].push(u);
    cost_s[u].push(b);
    cost_s[v].push(b);
    cost_y[u].push(b);
    cost_y[v].push(a);
    si[u] ++;
    si[v] ++;
  }
  auto c_s = [](int a, int b) { return di_s[a] > di_s[b]};
  auto c_y = [](int a, int b) { return di_y[a] > di_y[b]};
  di_s.assign(N, 1e16);
  di_y.assign(N, 1e16);
  di_y[s] = 0;
  di_s[t] = 0;
  priority_queue<int, vector<int>, decltype(c_s)>q_s(c_s);
  priority_queue<int, vector<int>, decltype(c_y)>q_s(c_y);
  for (int i = 0; i < n; i ++) {
    q_s.push(i);
    q_y.push(i);
  }
  while (!q_s.empty()) {
    int u = q_s.top();
    for (int i = 0; i < si[u]; i ++) {
      int v = snu[u].front();
      snu[u].pop();
      snu[u].push(v);
      long long c = cost_s[u].front();
      cost_s[u].pop();
      cost_s[u].push(c);
      if (di_s[v] > di_s[u] + c) di_s[v] = di_s[u] + c;
    }
    q_s.pop();
  }
  while (!q_y.empty()) {
    int u = q_y.top();
    for (int i = 0; i < si[u]; i ++) {
      int v = yen[u].front();
      yen[u].pop();
      yen[u].push(v);
      long long c = cost_s[u].front();
      cost_y[u].pop();
      cost_y[u].push(c);
      if (di_y[v] > di_y[u] + c) di_y[v] = di_y[u] + c;
    }
    q_y.pop();
  }
  long long ans[100003];
  ans[N] = 1e16;
  for (int i = N - 1; i >= 0; i --) {
    ans[i] = min(ans[i + 1], di_s[i] + di_y[i]);
  }
  for (int i = 0; i < N; i ++) {
    cout << 1e15 - ans[i] << endl;
  }


Compiler output:
a.cc: In lambda function:
a.cc:31:57: error: expected ';' before '}' token
   31 |   auto c_s = [](int a, int b) { return di_s[a] > di_s[b]};
      |                                                         ^
      |                                                         ;
a.cc: In lambda function:
a.cc:32:57: error: expected ';' before '}' token
   32 |   auto c_y = [](int a, int b) { return di_y[a] > di_y[b]};
      |                                                         ^
      |                                                         ;
a.cc: In function 'int main()':
a.cc:38:50: error: conflicting declaration 'std::priority_queue<int, std::vector<int>, main()::<lambda(int, int)> > q_s'
   38 |   priority_queue<int, vector<int>, decltype(c_y)>q_s(c_y);
      |                                                  ^~~
a.cc:37:50: note: previous declaration as 'std::priority_queue<int, std::vector<int>, main()::<lambda(int, int)> > q_s'
   37 |   priority_queue<int, vector<int>, decltype(c_s)>q_s(c_s);
      |                                                  ^~~
a.cc:39:23: error: 'n' was not declared in this scope
   39 |   for (int i = 0; i < n; i ++) {
      |                       ^
a.cc:41:5: error: 'q_y' was not declared in this scope; did you mean 'q_s'?
   41 |     q_y.push(i);
      |     ^~~
      |     q_s
a.cc:56:11: error: 'q_y' was not declared in this scope; did you mean 'q_s'?
   56 |   while (!q_y.empty()) {
      |           ^~~
      |           q_s
a.cc:76:4: error: expected '}' at end of input
   76 |   }
      |    ^
a.cc:6:13: note: to match this '{'
    6 | int main () {
      |             ^