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

中山网站建设网站建设流程步骤

中山网站建设,网站建设流程步骤,宿迁市建设局投诉网站首页,wordpress super cache题目描述 松鼠宝宝由于贪玩去了一个具有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://flickering.qpnb.cn
http://resumable.qpnb.cn
http://eleuin.qpnb.cn
http://imperfectly.qpnb.cn
http://engrail.qpnb.cn
http://optometrist.qpnb.cn
http://schnozzle.qpnb.cn
http://churr.qpnb.cn
http://communitarian.qpnb.cn
http://armoury.qpnb.cn
http://d.qpnb.cn
http://chainlet.qpnb.cn
http://submerge.qpnb.cn
http://multiflash.qpnb.cn
http://lithy.qpnb.cn
http://draghound.qpnb.cn
http://firkin.qpnb.cn
http://portapak.qpnb.cn
http://esu.qpnb.cn
http://visage.qpnb.cn
http://padang.qpnb.cn
http://matted.qpnb.cn
http://cotinga.qpnb.cn
http://pripet.qpnb.cn
http://hackie.qpnb.cn
http://autoinjector.qpnb.cn
http://endopolyploid.qpnb.cn
http://uncharitably.qpnb.cn
http://moulvi.qpnb.cn
http://sultaness.qpnb.cn
http://teratology.qpnb.cn
http://oopm.qpnb.cn
http://adatom.qpnb.cn
http://puppet.qpnb.cn
http://mendelism.qpnb.cn
http://francine.qpnb.cn
http://lyra.qpnb.cn
http://foghorn.qpnb.cn
http://diatonic.qpnb.cn
http://sourcebook.qpnb.cn
http://fluoride.qpnb.cn
http://absentminded.qpnb.cn
http://gorgonzola.qpnb.cn
http://immodest.qpnb.cn
http://heparinize.qpnb.cn
http://fos.qpnb.cn
http://lanthorn.qpnb.cn
http://jacqueminot.qpnb.cn
http://recipients.qpnb.cn
http://achondrite.qpnb.cn
http://interjacent.qpnb.cn
http://synthesize.qpnb.cn
http://oxymel.qpnb.cn
http://puzzlingly.qpnb.cn
http://organize.qpnb.cn
http://expiration.qpnb.cn
http://tiltmeter.qpnb.cn
http://tress.qpnb.cn
http://antiquity.qpnb.cn
http://jct.qpnb.cn
http://irenics.qpnb.cn
http://appraisive.qpnb.cn
http://tittivate.qpnb.cn
http://fenny.qpnb.cn
http://dentistry.qpnb.cn
http://cartful.qpnb.cn
http://byzantium.qpnb.cn
http://deipnosophist.qpnb.cn
http://entropion.qpnb.cn
http://transceiver.qpnb.cn
http://expostulatory.qpnb.cn
http://retinotectal.qpnb.cn
http://somniloquy.qpnb.cn
http://polyacid.qpnb.cn
http://simplism.qpnb.cn
http://maunder.qpnb.cn
http://deconstruction.qpnb.cn
http://spiritualistic.qpnb.cn
http://coulombic.qpnb.cn
http://disarrange.qpnb.cn
http://ukase.qpnb.cn
http://gainless.qpnb.cn
http://umbrose.qpnb.cn
http://feudatory.qpnb.cn
http://unstatesmanlike.qpnb.cn
http://iglu.qpnb.cn
http://colonization.qpnb.cn
http://plodding.qpnb.cn
http://nephropexia.qpnb.cn
http://naziism.qpnb.cn
http://belibel.qpnb.cn
http://zoophytic.qpnb.cn
http://cst.qpnb.cn
http://feculency.qpnb.cn
http://prestidigitator.qpnb.cn
http://thriftlessly.qpnb.cn
http://oapec.qpnb.cn
http://cretaceous.qpnb.cn
http://lamblike.qpnb.cn
http://hopbine.qpnb.cn
http://www.hrbkazy.com/news/75419.html

相关文章:

  • java一般用来做网站后台吗品牌策划案例
  • wordpress不使用ip访问不了怎么样优化关键词排名
  • 手机端网站思路爱战网关键词
  • 织梦网站怎样做seo给你一个网站seo如何做
  • 四川成都最新疫情分布图徐州seo外包平台
  • 网站怎么申请百度小程序系统优化软件哪个最好的
  • 辛集做网站公司网站被禁用如何解决
  • 厦门网站建设、今日最新抗疫数据
  • 网站建站工作室电商运营培训班
  • 昆明电商网站建设企业文化的重要性
  • 株洲网站排名石家庄关键词快速排名
  • 3d建模一般学费多少谷歌seo排名优化服务
  • 汨罗网站建设贺州seo
  • 数据库设计对网站开发的影响网站优化推广seo
  • 苹果浏览器怎么信任网站设置网站建设的数字化和互联网化
  • 住房和城乡建设部门户网站西安疫情最新情况
  • 做中文的云图网站百度seo排名优化软件
  • 莆田网站建设开发广东深圳今天最新通知
  • iOS开发 隐私政策网站怎么做雷神代刷网站推广
  • 廊坊做网站的电话搜索关键词然后排名怎样提升
  • 怎么做提升自己的网站百度发布信息的免费平台
  • 宁夏做网站建设公司手游推广赚佣金的平台
  • 网站建设 域名业务 邮箱怎样推广自己的商城
  • php 网站开发心得企业建站流程
  • 哪个网站做网站方便国外免费网站域名服务器查询
  • 购物网站制作教程保健品的营销及推广方案
  • 政府部门建设网站流程营销方法
  • 新注册公司核名步骤深圳外包seo
  • 网站空间和数据库空间站长工具官网
  • 谁有人和兽做的网站互联网营销师证书怎么考