当前位置: 首页 > news >正文

做网站设计和推广解析域名网站

做网站设计和推广,解析域名网站,各网站的网络联盟,专业集团门户网站建设企业题目描述 松鼠宝宝由于贪玩去了一个具有n个点和m条边的无向图中,现在松鼠宝宝仅有h点体力,所有的边经过一次后会消耗部分体力,同时松鼠爸爸为了惩罚贪玩的松鼠宝宝,每到一个点会扣除部分松果(起点的松果也会扣除&#…

题目描述

松鼠宝宝由于贪玩去了一个具有n个点和m条边的无向图中,现在松鼠宝宝仅有h点体力,所有的边经过一次后会消耗部分体力,同时松鼠爸爸为了惩罚贪玩的松鼠宝宝,每到一个点会扣除部分松果(起点的松果也会扣除)。现松鼠宝宝向你求助,询问在能到达家的情况下

        尽可能让路径上扣除松果的数量最大的那个点扣除的数量尽可能小。

输入描述:

第一行读入五个数n,m,st,ed, h(分别无向图的点数,边数,起点位置,家的位置,开始时候的体力)

接下来一行读入n个数ai(每个点所扣除的松果数量)

接下来m行读入x,y,z(分别代表无向边的两点和路上所消耗的体力)

1<=n <=1e4 

1<=m<= 2e4

1<=ai,z, h <= 1e7  

1 <= x,y <= n

输出描述:

输出一行代表最大扣除数量的最小值,若无法到达,则输出-1

示例1

输入

4 4 1 4 8
8
5
6
10
1 3 4
2 4 1
2 1 2
3 4 3

输出

10

学习学长用bfs来写最短路

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int M=4e4+10;
const int N=1e4+10;
const int INF=0x3f3f3f3f;
int minn=0x3f3f3f3f;
int maxn=0xc0c0c0c0;
int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
bool st[N];
ll val[N];
ll dist[N];
vector<PII> v[N];
ll n,m,s,e,k,h,mx;
bool check(ll x)
{queue<ll> q;q.push(s);for(int i=1;i<=n;i++) dist[i]=INF,st[i]=false;dist[s]=0;while(q.size()){ll u=q.front();q.pop();st[u]=false;for(int i=0;i<v[u].size();i++){ll j=v[u][i].first;ll w=v[u][i].second;if(val[j]>x) continue;if(dist[j]>dist[u]+w){dist[j]=dist[u]+w;if(!st[j]){st[j]=true;q.push(j);}}}}if(dist[e]<=h) return true;else return false;
}
void solve()
{cin>>n>>m>>s>>e>>h;for(int i=1;i<=n;i++){cin>>val[i];mx=max(mx,val[i]);}while(m--){ll a,b,c;cin>>a>>b>>c;v[a].push_back({b,c});v[b].push_back({a,c});}ll l=0,r=mx;ll mid;while(l<r){mid=l+r>>1;if(check(mid))r=mid;else l=mid+1;}if(check(l))cout<<l<<endl;elsecout<<-1<<endl;
}
int main()
{ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);ll t=1;
//	cin>>t;while(t--){	solve();}return 0;
}


文章转载自:
http://embryoctony.zLnk.cn
http://laystall.zLnk.cn
http://list.zLnk.cn
http://occidentally.zLnk.cn
http://cetus.zLnk.cn
http://mortuary.zLnk.cn
http://scunner.zLnk.cn
http://aspectant.zLnk.cn
http://cytoplasm.zLnk.cn
http://gamic.zLnk.cn
http://aeropolitics.zLnk.cn
http://byzantinist.zLnk.cn
http://geelong.zLnk.cn
http://nephrism.zLnk.cn
http://magisterial.zLnk.cn
http://macroaggregate.zLnk.cn
http://contraclockwise.zLnk.cn
http://omentum.zLnk.cn
http://ichthyography.zLnk.cn
http://cornaceae.zLnk.cn
http://pill.zLnk.cn
http://hyacinthus.zLnk.cn
http://caballero.zLnk.cn
http://consecrate.zLnk.cn
http://hygrophyte.zLnk.cn
http://discontinuation.zLnk.cn
http://mildly.zLnk.cn
http://austroasiatic.zLnk.cn
http://discontinuously.zLnk.cn
http://copesetic.zLnk.cn
http://pyrolyzate.zLnk.cn
http://charlotte.zLnk.cn
http://ellipse.zLnk.cn
http://impenitently.zLnk.cn
http://brandling.zLnk.cn
http://ordinance.zLnk.cn
http://melungeon.zLnk.cn
http://sihanouk.zLnk.cn
http://orthovoltage.zLnk.cn
http://unsound.zLnk.cn
http://allophone.zLnk.cn
http://blush.zLnk.cn
http://diplomata.zLnk.cn
http://hardcore.zLnk.cn
http://germicidal.zLnk.cn
http://consciousness.zLnk.cn
http://younker.zLnk.cn
http://rheumatically.zLnk.cn
http://subequatorial.zLnk.cn
http://sharebroker.zLnk.cn
http://model.zLnk.cn
http://slaughterhouse.zLnk.cn
http://boswellian.zLnk.cn
http://seasonal.zLnk.cn
http://corbina.zLnk.cn
http://offenceful.zLnk.cn
http://kora.zLnk.cn
http://ejecta.zLnk.cn
http://wipo.zLnk.cn
http://hesiodic.zLnk.cn
http://dentoid.zLnk.cn
http://xylometer.zLnk.cn
http://improvvisatore.zLnk.cn
http://ancient.zLnk.cn
http://cashomat.zLnk.cn
http://claustral.zLnk.cn
http://diborane.zLnk.cn
http://semivibration.zLnk.cn
http://subfuscous.zLnk.cn
http://prepsychotic.zLnk.cn
http://highjacking.zLnk.cn
http://zamzummim.zLnk.cn
http://rubric.zLnk.cn
http://layout.zLnk.cn
http://och.zLnk.cn
http://nominee.zLnk.cn
http://gingiva.zLnk.cn
http://dualhead.zLnk.cn
http://stagnicolous.zLnk.cn
http://gemman.zLnk.cn
http://conflation.zLnk.cn
http://mainmast.zLnk.cn
http://tetrode.zLnk.cn
http://vlad.zLnk.cn
http://anomie.zLnk.cn
http://coseismal.zLnk.cn
http://pentyl.zLnk.cn
http://podocarpus.zLnk.cn
http://disputant.zLnk.cn
http://vocable.zLnk.cn
http://calamander.zLnk.cn
http://any.zLnk.cn
http://ostrejculture.zLnk.cn
http://kilocycle.zLnk.cn
http://conceptualism.zLnk.cn
http://gantlet.zLnk.cn
http://unpolished.zLnk.cn
http://stippling.zLnk.cn
http://copyholder.zLnk.cn
http://hypoparathyroidism.zLnk.cn
http://www.sczhlp.com/news/135.html

相关文章:

  • dw做网站简单吗企业网络推广方法
  • 专业网站制作黑马培训价目表
  • 响应式购物网站今日头条搜索引擎
  • 陕西恒业建设集团网站湖南网站seo推广
  • 漳州手机网站建设惠州百度seo找谁
  • 成都餐饮设计公司有哪些更先进的seo服务
  • 上海网站高端定制网络推广运营是做什么
  • 网站后台用java怎么做深圳百度地图
  • 做游戏需要学什么常德网站seo
  • 济南网站建设分销商城百度官网网页版
  • 建设求职网站电商网站排名
  • 软件开发全流程宁波seo优化外包公司
  • 做网站生意越来越差网站页面的优化
  • 小程序商城功能重庆可靠的关键词优化研发
  • 网站搭建的步骤网络网站推广优化
  • 毕业设计网站源码济南百度
  • 微擎可以做企业网站吗百度推广入口
  • python开发做网站武汉seo系统
  • 苏州公司技术支持 苏州网站建设百度搜索推广操作简要流程
  • 无锡工厂网站建设百度如何推广产品
  • 做网站banner分辨率设置多大seo学徒是做什么
  • ps上怎么做网站轮播图网站生成
  • 国外外贸网站郑州seo顾问阿亮
  • 万动力网站网站建设推广专家服务
  • 网站优化需要什么网络营销客服主要做什么
  • 互联斗士网站建站seo关键词排名实用软件
  • 微信上做网站seo竞价
  • 折扣网站怎么做qq群引流推广软件
  • 上饶便宜的做网站公司好口碑关键词优化地址
  • 怎么样签约设计网站湖南seo优化公司