Language: C++

#include<bits/stdc++.h>
#include<queue>
using namespace std;
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] ++;
  }
  vector<long long>di_s(N, 1e16);
  vector<long long>di_y(N, 1e16);
  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_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 function 'int main()':
a.cc:7:25: error: 'N' was not declared in this scope
    7 |   vector<queue<int>>snu(N);
      |                         ^
a.cc: In lambda function:
a.cc:31:40: error: 'di_s' is not captured
   31 |   auto c_s = [](int a, int b) { return di_s[a] > di_s[b]};
      |                                        ^~~~
a.cc:31:15: note: the lambda has no capture-default
   31 |   auto c_s = [](int a, int b) { return di_s[a] > di_s[b]};
      |               ^
a.cc:29:20: note: 'std::vector<long long int> di_s' declared here
   29 |   vector<long long>di_s(N, 1e16);
      |                    ^~~~
a.cc:31:50: error: 'di_s' is not captured
   31 |   auto c_s = [](int a, int b) { return di_s[a] > di_s[b]};
      |                                                  ^~~~
a.cc:31:15: note: the lambda has no capture-default
   31 |   auto c_s = [](int a, int b) { return di_s[a] > di_s[b]};
      |               ^
a.cc:29:20: note: 'std::vector<long long int> di_s' declared here
   29 |   vector<long long>di_s(N, 1e16);
      |                    ^~~~
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:40: error: 'di_y' is not captured
   32 |   auto c_y = [](int a, int b) { return di_y[a] > di_y[b]};
      |                                        ^~~~
a.cc:32:15: note: the lambda has no capture-default
   32 |   auto c_y = [](int a, int b) { return di_y[a] > di_y[b]};
      |               ^
a.cc:30:20: note: 'std::vector<long long int> di_y' declared here
   30 |   vector<long long>di_y(N, 1e16);
      |                    ^~~~
a.cc:32:50: error: 'di_y' is not captured
   32 |   auto c_y = [](int a, int b) { return di_y[a] > di_y[b]};
      |                                                  ^~~~
a.cc:32:15: note: the lambda has no capture-default
   32 |   auto c_y = [](int a, int b) { return di_y[a] > di_y[b]};
      |               ^
a.cc:30:20: note: 'std::vector<long long int> di_y' declared here
   30 |   vector<long long>di_y(N, 1e16);
      |                    ^~~~
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:36:50: error: conflicting declaration 'std::priority_queue<int, std::vector<int>, main()::<lambda(int, int)> > q_s'
   36 |   priority_queue<int, vector<int>, decltype(c_y)>q_s(c_y);
      |                                                  ^~~
a.cc:35:50: note: previous declaration as 'std::priority_queue<int, std::vector<int>, main()::<lambda(int, int)> > q_s'
   35 |   priority_queue<int, vector<int>, decltype(c_s)>q_s(c_s);
      |                                                  ^~~
a.cc:39:5: error: 'q_y' was not declared in this scope; did you mean 'q_s'?
   39 |     q_y.push(i);
      |     ^~~
      |     q_s
a.cc:54:11: error: 'q_y' was not declared in this scope; did you mean 'q_s'?
   54 |   while (!q_y.empty()) {
      |           ^~~
      |           q_s
a.cc:74:4: error: expected '}' at end of input
   74 |   }
      |    ^
a.cc:4:13: note: to match this '{'
    4 | int main () {
      |             ^