Language: C++

#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 1000007
#define INF63 1061109567
#define INF127 9187201950435737471
#define UINF 18446744073709551615
#define F first
#define S second
#define ll long long
#define N 110
using namespace std;
ll n,m,s,dp[55][N*N],c[55],d[55],sum=0;
vector<pair<ll,pair<ll,ll> > > vt[55];
priority_queue<pair<ll,pair<ll,ll> > > pq;
int main(){
	ll i,j,x,y,a,b;&m,&s);
	for(i=0;i<m;i++)
	scanf("%lld%lld%lld",&n,
	{
		scanf("%lld%lld%lld%lld",&x,&y,&a,&b);
		sum+=a;
		x--;
		y--;
		vt[x].push_back(make_pair(y,make_pair(a,b)));
		vt[y].push_back(make_pair(x,make_pair(a,b)));
	}
	for(i=0;i<n;i++)
	{
		scanf("%lld%lld",&c[i],&d[i]);
	}
	memset(dp,127,sizeof(dp));
	dp[0][min(s,8500)]=0;
	pq.push(make_pair(0,make_pair((ll)0,min(s,2*sum))));
	while(!pq.empty())
	{
		x=pq.top().S.F;
		a=-pq.top().F;
		b=pq.top().S.S;
		pq.pop();
		if(dp[x][b]<a)
		{
			continue;
		}
		for(i=0;i<vt[x].size();i++)//走到另外一个地方 
		{
			if(b<vt[x][i].S.F)
			{
				continue;
			}
			y=vt[x][i].F;
			if(dp[y][b-vt[x][i].S.F]>a+vt[x][i].S.S)
			{
				dp[y][b-vt[x][i].S.F]=a+vt[x][i].S.S;
				pq.push(make_pair(-dp[y][b-vt[x][i].S.F],make_pair(y,b-vt[x][i].S.F)));
			}
		}
		for(i=b+c[x];i<=8500;i+=c[x])//兑换银币 
		{
			if(dp[x][i]>a+(i-b)/c[x]*d[x])
			{
				dp[x][i]=a+(i-b)/c[x]*d[x];
				pq.push(make_pair(-dp[x][i],make_pair(x,i)));
			}
		}
	}
	for(i=1;i<n;i++)
	{
		a=LINF;
		for(j=0;j<=8500;j++)
		{
			a=min(a,dp[i][j]);
		}
		printf("%lld\n",a);
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:29: error: expected ';' before ')' token
   18 |         ll i,j,x,y,a,b;&m,&s);
      |                             ^
      |                             ;
a.cc:22:54: error: expected '}' before ';' token
   22 |                 scanf("%lld%lld%lld%lld",&x,&y,&a,&b);
      |                                                      ^
a.cc:21:9: note: to match this '{'
   21 |         {
      |         ^
a.cc:22:54: error: expected ')' before ';' token
   22 |                 scanf("%lld%lld%lld%lld",&x,&y,&a,&b);
      |                                                      ^
      |                                                      )
a.cc:20:14: note: to match this '('
   20 |         scanf("%lld%lld%lld",&n,
      |              ^
a.cc: At global scope:
a.cc:29:9: error: expected unqualified-id before 'for'
   29 |         for(i=0;i<n;i++)
      |         ^~~
a.cc:29:17: error: 'i' does not name a type
   29 |         for(i=0;i<n;i++)
      |                 ^
a.cc:29:21: error: 'i' does not name a type
   29 |         for(i=0;i<n;i++)
      |                     ^
a.cc:33:15: error: expected constructor, destructor, or type conversion before '(' token
   33 |         memset(dp,127,sizeof(dp));
      |               ^
a.cc:34:9: error: 'dp' does not name a type
   34 |         dp[0][min(s,8500)]=0;
      |         ^~
a.cc:35:9: error: 'pq' does not name a type
   35 |         pq.push(make_pair(0,make_pair((ll)0,min(s,2*sum))));
      |         ^~
a.cc:36:9: error: expected unqualified-id before 'while'
   36 |         while(!pq.empty())
      |         ^~~~~
a.cc:68:9: error: expected unqualified-id before 'for'
   68 |         for(i=1;i<n;i++)
      |         ^~~
a.cc:68:17: error: 'i' does not name a type
   68 |         for(i=1;i<n;i++)
      |                 ^
a.cc:68:21: error: 'i' does not name a type
   68 |         for(i=1;i<n;i++)
      |                     ^
a.cc:77:9: error: expected unqualified-id before 'return'
   77 |         return 0;
      |         ^~~~~~
a.cc:78:1: error: expected declaration before '}' token
   78 | }
      | ^