Language: C++

#include "bits/stdc++.h"
using namespace std;

typedef pair<long long, long long> P;
long long INF = 1145141919810364364;

int main() {
	int N, M, S, T;
	static long long YenDis[100000], SnuukDis[100000], ANS[100000];
	static vector<P> Yen[100000], Snuuk[100000];
	priority_queue<P, vector<V>, greater<V> > PQYen, PQSnuuk;
	cin >> N >> M >> S >> T;
	S--, T--;
	for (int i = 0; i < N; i++) {
		YenDis[i] = INF;
		SnuukDis[i] = INF;
	}
	YenDis[S] = 0;
	SnuukDis[T] = 0;
	for (int i = 0; i < M; i++) {
		long long U, V, A, B;
		cin >> U >> V >> A >> B;
		U--, V--;
		Yen[U].push_back(P(A, V));
		Yen[V].push_back(P(A, U));
		Snuuk[U].push_back(P(B, V));
		Snuuk[V].push_back(P(B, U));
	}
	for (P p : Yen[S]) PQYen.push(p), YenDis[p.second] = p.first;
	for (P p : Snuuk[T]) PQSnuuk.push(p), SnuukDis[p.second] = p.first;
	while (PQYen.size()) {
		P p = PQYen.top();
		PQYen.pop();
		for (P q : Yen[p.second]) {
			if (YenDis[q.second] > YenDis[p.second] + q.first) {
				YenDis[q.second] = YenDis[p.second] + q.first;
				PQYen.push(q);
			}
		}
	}
	while (PQSnuuk.size()) {
		P p = PQSnuuk.top();
		PQSnuuk.pop();
		for (P q : Snuuk[p.second]) {
			if (SnuukDis[q.second] > SnuukDis[p.second] + q.first) {
				SnuukDis[q.second] = SnuukDis[p.second] + q.first;
				PQSnuuk.push(q);
			}
		}
	}
	ANS[0] = YenDis[N - 1] + SnuukDis[N - 1];
	for (int i = 1; i < N; i++) {
		ANS[i] = min(ANS[i - 1], YenDis[N - 1 - i] + SnuukDis[N - i - 1]);
	}
	for (int i = N - 1; i >= 0; i--) {
		cout << 1000000000000000 - ANS[i] << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:34: error: 'V' was not declared in this scope
   11 |         priority_queue<P, vector<V>, greater<V> > PQYen, PQSnuuk;
      |                                  ^
a.cc:11:35: error: template argument 1 is invalid
   11 |         priority_queue<P, vector<V>, greater<V> > PQYen, PQSnuuk;
      |                                   ^
a.cc:11:35: error: template argument 2 is invalid
a.cc:11:49: error: template argument 2 is invalid
   11 |         priority_queue<P, vector<V>, greater<V> > PQYen, PQSnuuk;
      |                                                 ^
a.cc:11:49: error: template argument 3 is invalid
a.cc:29:34: error: request for member 'push' in 'PQYen', which is of non-class type 'int'
   29 |         for (P p : Yen[S]) PQYen.push(p), YenDis[p.second] = p.first;
      |                                  ^~~~
a.cc:30:38: error: request for member 'push' in 'PQSnuuk', which is of non-class type 'int'
   30 |         for (P p : Snuuk[T]) PQSnuuk.push(p), SnuukDis[p.second] = p.first;
      |                                      ^~~~
a.cc:31:22: error: request for member 'size' in 'PQYen', which is of non-class type 'int'
   31 |         while (PQYen.size()) {
      |                      ^~~~
a.cc:32:29: error: request for member 'top' in 'PQYen', which is of non-class type 'int'
   32 |                 P p = PQYen.top();
      |                             ^~~
a.cc:33:23: error: request for member 'pop' in 'PQYen', which is of non-class type 'int'
   33 |                 PQYen.pop();
      |                       ^~~
a.cc:37:39: error: request for member 'push' in 'PQYen', which is of non-class type 'int'
   37 |                                 PQYen.push(q);
      |                                       ^~~~
a.cc:41:24: error: request for member 'size' in 'PQSnuuk', which is of non-class type 'int'
   41 |         while (PQSnuuk.size()) {
      |                        ^~~~
a.cc:42:31: error: request for member 'top' in 'PQSnuuk', which is of non-class type 'int'
   42 |                 P p = PQSnuuk.top();
      |                               ^~~
a.cc:43:25: error: request for member 'pop' in 'PQSnuuk', which is of non-class type 'int'
   43 |                 PQSnuuk.pop();
      |                         ^~~
a.cc:47:41: error: request for member 'push' in 'PQSnuuk', which is of non-class type 'int'
   47 |                                 PQSnuuk.push(q);
      |                                         ^~~~