最短路径
Lawliet_ZMZ
ACMERandNODER
展开
-
POJ 1797 最大运载量
Heavy TransportationTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 29430 Accepted: 7864DescriptionBackgroundHugo Heavy is happy. After the breakdown of原创 2016-08-03 15:20:24 · 262 阅读 · 0 评论 -
PAT天梯赛L2-001. 紧急救援 dijk经典最短路劲+点权最大+记录路径
L2-001. 紧急救援时间限制200 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救援原创 2017-03-15 18:23:54 · 982 阅读 · 0 评论 -
POJ1724 Dij队列优化邻接表
ROADSTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 14737 Accepted: 5341DescriptionN cities named with numbers 1 ... N are connected with one-way roa原创 2017-04-12 19:12:48 · 817 阅读 · 0 评论 -
POJ 2502 Subway 关键在建图
SubwayTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9718 Accepted: 3146DescriptionYou have just moved from a quiet Waterloo neighbourhood to a big,原创 2017-04-14 18:36:58 · 438 阅读 · 0 评论 -
Dijkstra队列优化矩阵版
#include #define INF 0x3f3f3f3f //定义一个很大的数using namespace std;const int maxn = 100 + 10;int vis[maxn];int mp[maxn][maxn];int v[maxn][maxn];int dis[maxn];int mon[maxn][maxn];int val[maxn]原创 2017-04-12 18:46:12 · 430 阅读 · 0 评论 -
HDU 2680 有点坑的稠密图最短路(dij各版本)
Choose the best routeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14431 Accepted Submission(s): 4711Problem DescriptionOne原创 2017-05-03 14:36:49 · 377 阅读 · 0 评论 -
2017XDU初赛网络赛
问题 C: 大大数星星时间限制: 1 Sec 内存限制: 128 MB提交: 1928 解决: 655[提交][状态][讨论版]题目描述喜欢数星星真是个传染病,这一天大大和大嫂晚上走在路上抬头看到很多星星,他们发现星星密密麻麻的布满了整个天空,大嫂说她想用线将天空的星星分割开,但是只给大大n根无限长的直线!大大为了让大嫂开心,想问问你最多能把星星分割成多少份!原创 2017-04-23 19:09:03 · 445 阅读 · 0 评论 -
XTU2016CCPC中南邀请赛C
Hamiltonian PathAccepted : 74 Submit : 189Time Limit : 2000 MS Memory Limit : 65536 KB Hamiltonian PathIn ICPCCamp, there are n cities and m direc原创 2017-04-27 21:39:54 · 600 阅读 · 0 评论 -
HDU 2017女生赛04 (变形最短路)
Deleting EdgesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 263 Accepted Submission(s): 85Problem DescriptionLittle Q is原创 2017-05-10 03:01:45 · 474 阅读 · 0 评论 -
再谈Dijkstra算法和堆优化
用邻接矩阵的Dijkstra算法的代码:int mp[maxn][maxn];int dis[maxn];bool visit[maxn];int n,m; //V,E void Dijkstra( int s ) { int i,v,u; for( i=1; i<=n; ++i ) {原创 2017-05-19 10:47:10 · 18650 阅读 · 6 评论 -
Uva247 Floyd传递闭包+map处理
链接:https://vjudge.net/problem/UVA-247 题意:a打给b,b打给c,c打给d,d打给a,那么这四个人就在一个圈里,具有传递性,离散数学传递闭包的经典题目,a可以通过bc到达d,因为d可以到达a,所以a和d在一个圈,b可以通过cd到达a,a也可以到达b,所以ab在一个圈。如果e打给f,f不能直接或者间接打给e,那么这两个人就不在一个圈,找出所有的圈。原创 2017-04-09 20:57:44 · 414 阅读 · 0 评论 -
3259 spfa判断负环(邻接表)
WormholesTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 44174 Accepted: 16235DescriptionWhile exploring his many farms, Farmer John has discovered a nu原创 2016-08-10 11:02:07 · 343 阅读 · 0 评论 -
POJ 2240 利率变权值 Floyd变乘法
ArbitrageTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20575 Accepted: 8768DescriptionArbitrage is the use of discrepancies in currency exchange rates t原创 2016-08-03 21:08:48 · 493 阅读 · 0 评论 -
POJ 1062 坑爹的聘礼(枚举等级差选择性找边)
昂贵的聘礼Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 45367 Accepted: 13436Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。原创 2016-08-04 18:13:55 · 477 阅读 · 0 评论 -
POJ 2387 Bellman双重边
Til the Cows Come HomeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 44129 Accepted: 15001DescriptionBessie is out in the field and wants to get back to the barn t原创 2016-08-05 10:00:59 · 438 阅读 · 0 评论 -
POJ 1511 SPFA+邻接矩阵 正图和反图相加
Invitation CardsTime Limit: 8000MS Memory Limit: 262144KTotal Submissions: 25066 Accepted: 8277DescriptionIn the age of television, not many people attend theater performance原创 2016-08-06 16:47:11 · 821 阅读 · 0 评论 -
POJ 2253 Floyd算法的巧妙改动
FroggerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 37130 Accepted: 11944DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly原创 2016-08-03 10:38:22 · 255 阅读 · 0 评论 -
POJ 1125 可不可能遍历所有点情况下的最短路径
Stockbroker GrapevineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 33859 Accepted: 18711DescriptionStockbrokers are known to overreact to rumours. You h原创 2016-08-03 11:25:54 · 1077 阅读 · 0 评论 -
POJ 1860 Bellman改判断正环
Currency ExchangeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 26610 Accepted: 9842DescriptionSeveral currency exchange points are working in our city.原创 2016-08-06 15:19:40 · 556 阅读 · 0 评论 -
POJ 1122 反向建图Dijkstra+记录路径 输入格式坑
FDNY to the Rescue!Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 2897 Accepted: 887DescriptionThe Fire Department of New York (FDNY) has always been proud of thei原创 2016-08-06 18:01:05 · 494 阅读 · 0 评论 -
POJ 1847 最短路径 垃圾水题可是坑爹多case问题初始化的锅
TramTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 13527 Accepted: 4978DescriptionTram network in Zagreb consists of a number of intersections and rails原创 2016-08-09 20:22:11 · 590 阅读 · 0 评论 -
SPFA的队列优化模板
#include&lt;iostream&gt;#include&lt;algorithm&gt;#include&lt;cstring&gt;#include&lt;string&gt;#include&lt;set&gt;#include&lt;queue&gt;using namespace std;原创 2018-04-16 15:15:10 · 296 阅读 · 0 评论