Loi_Cunese|CODEVS|1557|热浪

#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>

using namespace std;
int t,C,S,e,tot=0;

struct hh
{
	int f,t,c;
}a[12500];
int head[6500],jl[6500],ne[12500];
bool bo[6500];
queue<int>q;

void build(int x,int y,int z)
{
	tot++;
	a[tot].f=x;
	a[tot].t=y;
	a[tot].c=z;
	ne[tot]=head[x];
	head[x]=tot;
}

void f()
{
	while(!q.empty())
	{
		int s=q.front();
		q.pop();
		bo[s]=0;
		for(int i=head[s];i!=-1;i=ne[i])
		{
			int v=a[i].t;
			if(jl[v]>jl[s]+a[i].c)
			{
				jl[v]=jl[s]+a[i].c;
				if(bo[v]==0)
				{
					bo[v]=1;
					q.push(v);
				}
			}
		}
	}
}

int main()
{
	memset(head,-1,sizeof(head));
	memset(jl,0x3f,sizeof(jl));
	memset(bo,0,sizeof(bo));
	scanf("%d%d%d%d",&t,&C,&S,&e);
	int x,y,z;
	for(int i=1;i<=C;i++)
	{
		scanf("%d%d%d",&x,&y,&z);
		build(x,y,z);
		build(y,x,z);
	}
	q.push(S);
	bo[S]=1;
	jl[S]=0;
	f();
	cout<<jl[e];
	return 0;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
帮我地道的翻译:The differential variational inequalities ((DVIs), for short) are useful for the study of models involving both dynamics and constraints in the form of in￾equalities. They arise in many applications: electrical circuits with ideal diodes, Coulomb friction problems for contacting bodies, economical dynamics, dynamic traffic networks. Pang and Stewart [26], [27] established the existence, unique￾ness, and Lipschitz dependence of solutions subject to boundary conditions for (DVIs) in finite dimensional spaces. Han and Pang investigated a class of dif￾ferential quasi-variational inequalities in [11], and Li, Huang and O’Regan [18] studied a class of differential mixed variational inequalities in finite dimensional Well-Posedness of Differential Mixed Quasi-Variational-Inequalities 137 spaces. Gwinner [8] obtained an equivalence result between (DVIs) and projected dynamical systems. In [9] he also proved a stability property for (DVIs) by using the monotonicity method of Browder and Minty, and Mosco set convergence. Chen and Wang [4] studied dynamic Nash equilibrium problems which have the formulation of differential mixed quasi-variational inequalities. Elastoplastic contact problems can also be incorporated into (DMQVIs) formulation because general dynamic processes in the nonsmooth unilateral contact problems are governed by quasi-variational inequalities. A numerical study for nonsmooth contact problems with Tresca friction can be found in [10], Liu, Loi and Obukhovskii [19] studied the existence and global bifurcation for periodic solutions of a class of (DVIs) by using the topological degree theory for multivalued maps and the method of guiding functions. For more details about (DVIs) we refer to [3], [30], [12], [22]–[21].
05-30

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值