Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
int inf=1e18;

struct graph{

struct edge{int to,cst;};
struct pos{int i,d;
	pos(){};
	pos(int i_,int d_){i=i_,d=d_;};
	bool operator<(const pos& r)const{return d>r.d;}
};

	
vector<vector<edge>>g;
vector<bool>used;
int n;
int o;
vector<int>dist;
priority_queue<pos> pq;

	graph(){};
	graph(int n_,int o_){
	n=n_,o=o_;
	g.resize(n);
	used.assign(n,false);
	dist.resize(n,inf);
	};

	void add_edge(int x,y,cst){
		vector<int>cst={a,b};
		g[x].push_back(edge({y,cst}));
		g[y].push_back(edge({x,cst}));
	}

	void set_dist(){
		 pq.push(pos({o,0}));
		while(!pq.empty()){
			pos x=pq.top();pq.pop();
			if(d[x.i]<x.d)continue;
			for(auto&& w:g[x.i]){
				if(d[w.to]> x.d+w.cst){
					d[w.to]=x.d+w.cst;
					pq.push(pos(w.to,d[w.to]));
				}
			} 
		}	
	}

};



signed main(){
	int n,m,s,t;cin>>n>>m>>s>>t;s--;t--;
	graph g1(n,s),g2(n,t);
	for(int i=0;i<m;i++){
		int x,y,a,b;cin>>x>>y>>a>>b;x--;y--;
		g1.add_edge(x,y,a);
		g2.add_edge(x,y,b);
	}
	g1.set_dist();
	g2.set_dist();	
	int money=1e15;
	int cst=inf;
	vector<int>cs(n);
	for(i=n-1;i>=0;i--){
		cst=min(cst,gr1.dist[i]+gr2.dist[i]);
		cs[i]=cst;
	}
	for(int i=0;i<n;i++)cout<<money-cs[i]<<endl;
}



}


Compiler output:
a.cc:31:29: error: 'y' has not been declared
   31 |         void add_edge(int x,y,cst){
      |                             ^
a.cc:31:31: error: 'cst' has not been declared
   31 |         void add_edge(int x,y,cst){
      |                               ^~~
a.cc: In member function 'void graph::add_edge(long long int, int, int)':
a.cc:32:33: error: 'a' was not declared in this scope
   32 |                 vector<int>cst={a,b};
      |                                 ^
a.cc:32:35: error: 'b' was not declared in this scope
   32 |                 vector<int>cst={a,b};
      |                                   ^
a.cc:32:36: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<long long int>'
   32 |                 vector<int>cst={a,b};
      |                                    ^
      |                                    |
      |                                    <brace-enclosed initializer list>
a.cc:33:38: error: 'y' was not declared in this scope; did you mean 'yn'?
   33 |                 g[x].push_back(edge({y,cst}));
      |                                      ^
      |                                      yn
a.cc:33:44: error: no matching function for call to 'graph::edge::edge(<brace-enclosed initializer list>)'
   33 |                 g[x].push_back(edge({y,cst}));
      |                                            ^
a.cc:8:8: note: candidate: 'graph::edge::edge()'
    8 | struct edge{int to,cst;};
      |        ^~~~
a.cc:8:8: note:   candidate expects 0 arguments, 1 provided
a.cc:8:8: note: candidate: 'constexpr graph::edge::edge(const graph::edge&)'
a.cc:8:8: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const graph::edge&'
a.cc:8:8: note: candidate: 'constexpr graph::edge::edge(graph::edge&&)'
a.cc:8:8: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'graph::edge&&'
a.cc:34:44: error: no matching function for call to 'graph::edge::edge(<brace-enclosed initializer list>)'
   34 |                 g[y].push_back(edge({x,cst}));
      |                                            ^
a.cc:8:8: note: candidate: 'graph::edge::edge()'
    8 | struct edge{int to,cst;};
      |        ^~~~
a.cc:8:8: note:   candidate expects 0 arguments, 1 provided
a.cc:8:8: note: candidate: 'constexpr graph::edge::edge(const graph::edge&)'
a.cc:8:8: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const graph::edge&'
a.cc:8:8: note: candidate: 'constexpr graph::edge::edge(graph::edge&&)'
a.cc:8:8: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'graph::edge&&'
a.cc: In member function 'void graph::set_dist()':
a.cc:41:28: error: 'd' was not declared in this scope
   41 |                         if(d[x.i]<x.d)continue;
      |                            ^
a.cc:43:36: error: 'd' was not declared in this scope
   43 |                                 if(d[w.to]> x.d+w.cst){
      |                                    ^
a.cc: In function 'int main()':
a.cc:68:13: error: 'i' was not declared in this scope
   68 |         for(i=n-1;i>=0;i--){
      |             ^
a.cc:69:29: error: 'gr1' was not declared in this scope; did you mean 'g1'?
   69 |                 cst=min(cst,gr1.dist[i]+gr2.dist[i]);
      |                             ^~~
      |                             g1
a.cc:69:41: error: 'gr2' was not declared in this scope; did you mean 'g2'?
   69 |                 cst=min(cst,gr1.dist[i]+gr2.dist[i]);
      |                                         ^~~
      |                                         g2
a.cc: At global scope:
a.cc:77:1: error: expected declaration before '}' token
   77 | }
      | ^