Language: C++

//
//  soundhound2018d.cpp
//  
//
//  Created by Yoshida Satoshi on 2018/11/08.
//

#include <stdio.h>
#include <iostream>
#include <queue>
#include <utility>
#include <vector>

#define P make_pair<ll,ll>

#define MAX 100010
#define INF 10000000000000000

typedef long long ll;

using namespace std;

struct path
{
    ll v,a,b;
}

int main()
{
    ll n,m,s,t;
    vector<path> p[MAX];
    
    cin>>n>>m>>s>>t;
    s--;t--;
    for(ll i=0;i<m;i++)
    {
        ll u,v,a,b;
        u--;v--;
        p[u].push_back({v,a,b});
        p[v].push_back({u,a,b});
    }
    
    ll da[MAX],db[MAX];
    priority_queue<pair<ll,ll> ,vector<pair<ll,ll> , greater<pair<ll,ll> > > pa,pb;
    
    for(ll i=0;i<n;i++)
    {
        da[i]=db[i]=INF;
    }
    
    pa.push(P(0,s));
    pb.push(P(0,t));
    
    while(!pa.empty())
    {
        pair<ll,ll> x=pa.top();
        pa.pop();
        ll c=x.first;
        ll y=x.second;
        if(da[y]<c) continue;
        
        da[y]=c;
        
        for(ll i=0;i<p[y].size();i++)
        {
            ll v=p[y].v;
            ll a=p[y].a;
            pa.push(P(c+a,v));
        }
    }
    
    while(!pb.empty())
    {
        pair<ll,ll> x=pb.top();
        pb.pop();
        ll c=x.first;
        ll y=x.second;
        if(db[y]<c) continue;
        
        db[y]=c;
        
        for(ll i=0;i<p[y].size();i++)
        {
            ll v=p[y].v;
            ll b=p[y].b;
            pb.push(P(c+b,v));
        }
    }
    
    ll ans[MAX];
    ans[n]=INF;
    
    for(int i=n-1;i>=0;i--)
    {
        ans[i]=min(ans[i+1],da[i]+db[i]);
        ans[i]=1000000000000000-ans[i];
    }
    
    for(int i=0;i<n;i++) cout<<ans[i]<<endl;
    
    
    return 0;
}


Compiler output:
a.cc:26:2: error: expected ';' after struct definition
   26 | }
      |  ^
      |  ;
a.cc: In function 'int main()':
a.cc:44:81: error: template argument 2 is invalid
   44 |     priority_queue<pair<ll,ll> ,vector<pair<ll,ll> , greater<pair<ll,ll> > > pa,pb;
      |                                                                                 ^~
a.cc:44:81: error: template argument 3 is invalid
a.cc:51:5: error: 'pa' was not declared in this scope; did you mean 'da'?
   51 |     pa.push(P(0,s));
      |     ^~
      |     da
a.cc:51:17: error: cannot bind rvalue reference of type 'long long int&&' to lvalue of type 'll' {aka 'long long int'}
   51 |     pa.push(P(0,s));
      |                 ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:9:
/usr/include/c++/14/bits/stl_pair.h:1132:32: note:   initializing argument 2 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = long long int; _T2 = long long int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = long long int; typename decay<_Tp>::type = long long int; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = long long int; typename decay<_Tp2>::type = long long int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |                          ~~~~~~^~~
a.cc:52:5: error: 'pb' was not declared in this scope; did you mean 'db'?
   52 |     pb.push(P(0,t));
      |     ^~
      |     db
a.cc:52:17: error: cannot bind rvalue reference of type 'long long int&&' to lvalue of type 'll' {aka 'long long int'}
   52 |     pb.push(P(0,t));
      |                 ^
/usr/include/c++/14/bits/stl_pair.h:1132:32: note:   initializing argument 2 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = long long int; _T2 = long long int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = long long int; typename decay<_Tp>::type = long long int; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = long long int; typename decay<_Tp2>::type = long long int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |                          ~~~~~~^~~
a.cc:66:23: error: 'class std::vector<path>' has no member named 'v'
   66 |             ll v=p[y].v;
      |                       ^
a.cc:67:23: error: 'class std::vector<path>' has no member named 'a'; did you mean 'at'?
   67 |             ll a=p[y].a;
      |                       ^
      |                       at
a.cc:68:27: error: cannot bind rvalue reference of type 'long long int&&' to lvalue of type 'll' {aka 'long long int'}
   68 |             pa.push(P(c+a,v));
      |                           ^
/usr/include/c++/14/bits/stl_pair.h:1132:32: note:   initializing argument 2 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = long long int; _T2 = long long int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = long long int; typename decay<_Tp>::type = long long int; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = long long int; typename decay<_Tp2>::type = long long int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |                          ~~~~~~^~~
a.cc:84:23: error: 'class std::vector<path>' has no member named 'v'
   84 |             ll v=p[y].v;
      |                       ^
a.cc:85:23: error: 'class std::vector<path>' has no member named 'b'
   85 |             ll b=p[y].b;
      |                       ^
a.cc:86:27: error: cannot bind rvalue reference of type 'long long int&&' to lvalue of type 'll' {aka 'long long int'}
   86 |             pb.push(P(c+b,v));
      |                           ^
/usr/include/c++/14/bits/stl_pair.h:1132:32: note:   initializing argument 2 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = long long int; _T2 = long long int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = long long int; typename decay<_Tp>::type = long long int; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = long long int; typename decay<_Tp2>::type = long long int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |                          ~~~~~~^~~