Language: C++

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

#define rep(i, a) for (int i = 0; i < (a); i++ )
#define FOR(i, m, n) for(int i = m; i < n; i++)
 
typedef long long ll;
 
//const int INF = 1001001001;
const long long INF = 2e18;
const int MOD = 1000000007;
const double PI=acos(-1);


//-------------------------------------------------
struct edge{ll to, cost;};
//typedef pair<ll,ll> P;
struct graph{
  ll V;
  vector<vector<edge> > G;
  vector<ll> d;

  graph(ll n){
    init(n);
  }

  void init(ll n){
    V = n;
    G.resize(V);
    d.resize(V);
    for(int i=0; i<V; i++){
      d[i] = INF;
    }
  }

  void add_edge(ll s, ll t, ll cost){
    edge e;
    e.to = t, e.cost = cost;
    G[s].push_back(e);
  }

  void dijkstra(ll s){
    for(int i=0; i<V; i++){
      d[i] = INF;
    }
    d[s] = 0;
    priority_queue<pair<ll,ll>,vector<pair<ll,ll>>, greater<pair<ll,ll>> > que; //first:dist from start, second:next v
    que.push(P(0,s));
    while(!que.empty()){
      auto p = que.top(); que.pop();
      ll v = p.second;
      if(d[v]<p.first) continue;
      for(auto e : G[v]){
        if(d[e.to]>d[v]+e.cost){
          d[e.to] = d[v]+e.cost;
          que.push(make_pair(d[e.to],e.to));
        }
      }
    }
  }
};

int main() {
    int n,m,s,t;
    cin >> n >> m >> s >> t;
    s--,t--;
    graph g1(n), g2(n);

    rep(i,m) {
        int u,v,a,b;
        cin >> u >> v >> a >> b;
        u--,v--;
        g1.add_edge(u,v,a);
        g1.add_edge(v,u,a);
        g2.add_edge(u,v,b);
        g2.add_edge(v,u,b);
    }
    
    g1.dijkstra(s);
    g2.dijkstra(t);

    priority_queue<P, vector<P>> d;
    ll total = 1000000000000000;
    rep(i,n) {
        d.push(P(total-(g1.d[i] + g2.d[i]),i));
    }

    rep(i,n) {
        while (d.top().second<i) {
            d.pop();
        }
        auto ans = d.top();
        cout << ans.first << endl;
    }


}

Compiler output:
a.cc: In member function 'void graph::dijkstra(ll)':
a.cc:48:14: error: 'P' was not declared in this scope; did you mean 'PI'?
   48 |     que.push(P(0,s));
      |              ^
      |              PI
a.cc: In function 'int main()':
a.cc:82:20: error: 'P' was not declared in this scope
   82 |     priority_queue<P, vector<P>> d;
      |                    ^
a.cc:82:30: error: template argument 2 is invalid
   82 |     priority_queue<P, vector<P>> d;
      |                              ^
a.cc:82:31: error: template argument 1 is invalid
   82 |     priority_queue<P, vector<P>> d;
      |                               ^~
a.cc:82:31: error: template argument 2 is invalid
a.cc:82:31: error: template argument 3 is invalid
a.cc:85:11: error: request for member 'push' in 'd', which is of non-class type 'int'
   85 |         d.push(P(total-(g1.d[i] + g2.d[i]),i));
      |           ^~~~
a.cc:89:18: error: request for member 'top' in 'd', which is of non-class type 'int'
   89 |         while (d.top().second<i) {
      |                  ^~~
a.cc:90:15: error: request for member 'pop' in 'd', which is of non-class type 'int'
   90 |             d.pop();
      |               ^~~
a.cc:92:22: error: request for member 'top' in 'd', which is of non-class type 'int'
   92 |         auto ans = d.top();
      |                      ^~~