最短路径
qq_37383726
这个作者很懒,什么都没留下…
展开
-
最短路模版 【dijkstra】【floyd】
畅通工程续Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 31423 Accepted Submission(s): 11469Problem Description某省自从实行了很多年的畅原创 2017-02-28 00:05:55 · 233 阅读 · 0 评论 -
【POJ - 1062】昂贵的聘礼 【 枚举+超级源点+spfa】
年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:”嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。”探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,他原创 2017-07-23 11:43:03 · 367 阅读 · 0 评论 -
【hduoj 3416 】Marriage Match IV 【最小割dinic+最短路spfa】
Problem Description Do not sincere non-interference。 Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A and girls are in city B. Every原创 2017-07-26 15:20:12 · 439 阅读 · 0 评论 -
【 hdoj 4240】 Route Redundancy 【dinic+spfa】
Problem Description A city is made up exclusively of one-way steets.each street in the city has a capacity,which is the minimum of the capcities of the streets along that route.The redundancy ratio fr原创 2017-07-26 09:47:27 · 412 阅读 · 0 评论 -
【ZZULIOJ 2179:】 紧急营救 【spfa +枚举】
Description冷锋在非洲完成任务后回到了狼牙特种作战部队。我们知道在战狼二结尾,冷锋正在北极执行任务,而部队发现了龙小云在c国的消息,让冷锋尽快赶往c国。我们知道现在地球上共有n个国家和地区,编号分别为1,2,3…n。国家与国家之间的可能通航班(可能不止一次),也可能没有通航班。共有m次航班,冷锋已经知道了这m次航班的信息(起点 终点,时间)北极的编号是1,c国的编号是n。 而冷峰身为超级原创 2017-08-18 21:11:29 · 449 阅读 · 0 评论 -
【HPUOJ1413】StarFarming 【最短路】
题目描述 星农(StarFarming)公司计划要给员工发路费津贴,发放的规则是这样的:1到n-1代表各个员工家的序号,n代表公司。路费津贴只发给上班的最短路与回家的最短路的总路程最长的人。该市的路建造的有些奇怪,修路只修单行道,即只允许往某一个方向通行。现在给你城市的有向图的地图,TLG请你帮忙计算谁能得到津贴,以及他上班和回家的总路程是多少。输入 有多组测试数据。每组第一行输入两个整数N,M原创 2017-08-12 21:55:08 · 215 阅读 · 0 评论 -
HDU Today 【最短路径】+【构造map】
HDU Today Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 16535 Accepted Submission(s): 3917Problem Description 经过锦囊相助,海东集团终于度过了危机,从此,HDU原创 2017-03-31 12:37:59 · 449 阅读 · 0 评论 -
【2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛 】H Skiing 【求DAG图的最长路】
In this winter holiday, Bob has a plan for skiing at the mountain resort.This ski resort has MM different ski paths and NN different flags situated at those turning points.The ii-th path from the S_iS原创 2017-09-12 19:25:30 · 423 阅读 · 0 评论 -
Choose the best route 【最短路】+【反向建图】
One day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible . Now give you a map of the city’s traffic route, and th原创 2017-07-19 09:23:14 · 337 阅读 · 0 评论 -
【POJ 2391 】Ombrophobic Bovines 【floyd +二分+最大流】
FJ’s cows really hate getting wet so much that the mere thought of getting caught in the rain makes them shake in their hooves. They have decided to put a rain siren on the farm to let them know when r原创 2017-10-10 23:32:01 · 244 阅读 · 0 评论 -
【POJ- 2112】Optimal Milking 【floyd+二分+最大流】
FJ has moved his K (1 <= K <= 30) milking machines out into the cow pastures among the C (1 <= C <= 200) cows. A set of paths of various lengths runs among the cows and the milking machines. The milkin原创 2017-10-12 13:42:06 · 189 阅读 · 0 评论 -
【哈尔滨理工大学第七届程序设计竞赛初赛(高年级组)】 A B C D F G H I
A 凌波微步 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld 题目描述 小Z的体型实在是太胖了,每次和小D一起出门都跟不上小D的脚步,这让小Z很气馁,于是小Z跋山涉水,仿名山,遍古迹,终于找到了逍遥派。掌门看小Z求师虔诚,决定传小Z一套《凌波微步》。 这种腿法可以无视距离的行进,但缺点原创 2017-12-16 19:20:47 · 1410 阅读 · 0 评论 -
【hdoj 5294】 Tricks Device 【最小割+最短路spfa】
Innocent Wu follows Dumb Zhang into a ancient tomb. Innocent Wu’s at the entrance of the tomb while Dumb Zhang’s at the end of it. The tomb is made up of many chambers, the total number is N. And ther...原创 2017-07-25 09:28:55 · 232 阅读 · 0 评论 -
【牛客练习赛17】 A E【最短路 + 枚举 】
A长方体链接:https://www.nowcoder.com/acm/contest/109/A 来源:牛客网时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld 题目描述 给出共享长方体一个顶点的三个面的面积,求它十二条边的边长和。 输入描述: 一行三个整数a, b, c表示面积(...原创 2018-05-05 23:49:39 · 573 阅读 · 0 评论 -
find the safest road 【最长路】
XX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 ,现在8600 想出去旅游,面对这这么多的路,他想找一条最安全的路。但是8600 的数学不好,想请你帮忙 ^_^ In原创 2017-07-19 09:17:03 · 217 阅读 · 0 评论 -
迷宫游戏 51Nod - 1459 【最短路变形】
迷宫游戏 51Nod - 1459 你来到一个迷宫前。该迷宫由若干个房间组成,每个房间都有一个得分,第一次进入这个房间,你就可以得到这个分数。还有若干双向道路连结这些房间,你沿着这些道路从一个房间走到另外一个房间需要一些时间。游戏规定了你的起点和终点房间,你首要目标是从起点尽快到达终点,在满足首要目标的前提下,使得你的得分总和尽可能大。现在问题来了,给定房间、道路、分数、起点和终点等全部信息原创 2017-04-20 10:25:02 · 292 阅读 · 0 评论 -
最短路 【卡io】
先生的信与路由 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 324 Solved: 89 [Submit][Status][Web Board] Description L先生辛辛苦苦写完了要寄给朋友Z的信。信将在网络中传输,已知网络由n个路由器互连而成,路由器之间的链路费用由邻接矩阵表示,L先生的PC机和服务器分别接在路由器s和路由器原创 2017-05-29 16:59:43 · 389 阅读 · 0 评论 -
最短路【dijkstra】【floyd 】【spfa】
最短路Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 59741 Accepted Submission(s): 26304Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很原创 2017-02-28 00:35:30 · 208 阅读 · 0 评论 -
城市平乱 【最短路】
城市平乱时间限制:1000 ms | 内存限制:65535 KB难度:4描述南将军统领着N个部队,这N个部队分别驻扎在N个不同的城市。他在用这N个部队维护着M个城市的治安,这M个城市分别编号从1到M。现在,小工军师告诉南将军,第K号城市发生了暴乱,南将军从各个部队都派遣了一个分队沿最近路去往暴乱城市平乱。现在已知在任意两个城市之间原创 2017-03-09 07:43:42 · 199 阅读 · 0 评论 -
Frogger【最小生成树的变形】---路径上最小的最大权
Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists' sun原创 2017-03-07 20:05:33 · 293 阅读 · 0 评论 -
Tram 【最短路径】
N - Tram Tram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of the原创 2017-03-22 22:32:33 · 421 阅读 · 0 评论 -
Til the Cows Come Home 【最短路】
Til the Cows Come HomeBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her原创 2017-03-23 10:34:36 · 212 阅读 · 0 评论 -
C - Heavy Transportation 【最小生成树】
C - Heavy Transportation Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether th原创 2017-03-23 17:55:22 · 256 阅读 · 0 评论 -
Silver Cow Party 【双向最短路】
Silver Cow Party One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤原创 2017-03-23 19:33:00 · 337 阅读 · 0 评论 -
最短路径问题 【两权值的最短路】
最短路径问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 15050 Accepted Submission(s): 4582Problem Description 给你n个点,m条无向边,每条边都有长度d和花费p,给你起点原创 2017-03-31 12:39:13 · 265 阅读 · 0 评论 -
最短路
#include<stdio.h>#include<string.h>#include<algorithm>#include<iostream>#include<math.h>#include<queue>#include<stack>#include<map>#include<vector>#define LL long long#define M 1000000+100#原创 2017-04-04 22:51:55 · 165 阅读 · 0 评论 -
虚拟的城市之旅 【类spfa】+【正反 建图】
虚拟的城市之旅 时间限制:3000 ms | 内存限制:65535 KB 难度:6 描述展馆是未来城市的缩影,个人体验和互动是不变的主题。在A国展馆通过多维模式和高科技手段,引领参观者在展示空间踏上一段虚拟的城市之旅。 梦幻国有N个城市和M条道路,每条道路连接某两个城市。任意两个城市之间最多只有一条道路直接相连。这M条道路中有一部分为单向通行的道路,一部分为双向通行的道路。 梦幻国幅员原创 2017-04-27 20:26:49 · 372 阅读 · 1 评论 -
Til the Cows Come Home 【SPFA】 【djk】
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get ba原创 2017-04-18 19:46:01 · 227 阅读 · 0 评论 -
Silver Cow Party 【双向最短路】
One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional (one-way roa原创 2017-04-18 21:04:15 · 258 阅读 · 0 评论 -
[牛客国庆集训派对Day1] C[数学] L[最短路] J[线段树]
比赛链接C链接:https://www.nowcoder.com/acm/contest/201/C来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 1048576K,其他语言2097152K64bit IO Format: %lld题目描述算术是为数不多的会让Kuon感到棘手的事情。通常她会找Haku帮忙,但是Haku已经被她派去买东西了。于是她向你寻求帮...原创 2018-10-02 09:44:57 · 337 阅读 · 0 评论