Language: C++

#include <bits/stdc++.h>
#define INF 1e16
using namespace std;

typedef long long ll;
struct edge { ll to, cost; };
typedef pair<ll,ll> P; //firstは最短距離,secondは頂点の番号

int n
vector<edge> G1[100010],G2[100010];
ll d1[100010],d2[100010];

void dijkstra1(int s){//円での距離
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d1,d1+n,INF);
    d1[s]=0;
    que.push(P(0,s));

    while(!que.empty()){
        P p=que.top();que.pop();
        ll v=p.second;
        if(d1[v]<p.first)continue;
        for(int i=0;i<G1[v].size();i++){
            edge e=G1[v][i];
            if(d1[e.to]>d1[v]+e.cost){
                d1[e.to]=d1[v]+e.cost;
                que.push(P(d2[e.to],e.to));
            }
        }
    }
}
void dijkstra2(int s){//スヌークでの距離
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d2,d2+n,INF);
    d2[s]=0;
    que.push(P(0,s));

    while(!que.empty()){
        P p=que.top();que.pop();
        ll v=p.second;
        if(d2[v]<p.first)continue;
        for(int i=0;i<G2[v].size();i++){
            edge e=G2[v][i];
            if(d2[e.to]>d2[v]+e.cost){
                d2[e.to]=d2[v]+e.cost;
                que.push(P(d2[e.to],e.to));
            }
        }
    }
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    int m,s,t;
    cin>>n>>m>>s>>t;
    s--;
    t--;

    for(int i=0;i<m;i++){
        int u,v,a,b;
        cin>>u>>v>>a>>b;
        u--;
        v--;
        G1[u].push_back(edge{v,a});
        G1[v].push_back(edge{u,a});
        G2[u].push_back(edge{v,b});
        G2[v].push_back(edge{u,b});
    }

    dijkstra1(s);
    dijkstra2(t);

    //for(int i=0;i<n;i++)cout<<d1[i]<<" ";
    //cout<<endl;
    //for(int i=0;i<n;i++)cout<<d2[i]<<" ";
    //cout<<endl;

    ll ans[n]={};
    for(int i=0;i<n;i++)ans[i]=d1[i]+d2[i];
    for(int i=n-2;i>=0;i--){
        ans[i]=min(ans[i],ans[i+1]);
    }

    ll money=1e15;
    for(int i=0;i<n;i++){
        cout<<money-ans[i]<<endl;
    }
}

Compiler output:
a.cc:10:1: error: expected initializer before 'vector'
   10 | vector<edge> G1[100010],G2[100010];
      | ^~~~~~
a.cc: In function 'void dijkstra1(int)':
a.cc:15:16: error: 'n' was not declared in this scope
   15 |     fill(d1,d1+n,INF);
      |                ^
a.cc:23:23: error: 'G1' was not declared in this scope; did you mean 'y1'?
   23 |         for(int i=0;i<G1[v].size();i++){
      |                       ^~
      |                       y1
a.cc: In function 'void dijkstra2(int)':
a.cc:34:16: error: 'n' was not declared in this scope
   34 |     fill(d2,d2+n,INF);
      |                ^
a.cc:42:23: error: 'G2' was not declared in this scope; did you mean 'd2'?
   42 |         for(int i=0;i<G2[v].size();i++){
      |                       ^~
      |                       d2
a.cc: In function 'int main()':
a.cc:57:10: error: 'n' was not declared in this scope
   57 |     cin>>n>>m>>s>>t;
      |          ^
a.cc:66:9: error: 'G1' was not declared in this scope; did you mean 'y1'?
   66 |         G1[u].push_back(edge{v,a});
      |         ^~
      |         y1
a.cc:68:9: error: 'G2' was not declared in this scope; did you mean 'd2'?
   68 |         G2[u].push_back(edge{v,b});
      |         ^~
      |         d2
a.cc:81:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   81 |     for(int i=0;i<n;i++)ans[i]=d1[i]+d2[i];
      |                         ^~~
      |                         abs
a.cc:83:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   83 |         ans[i]=min(ans[i],ans[i+1]);
      |         ^~~
      |         abs
a.cc:88:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   88 |         cout<<money-ans[i]<<endl;
      |                     ^~~
      |                     abs