
最短路径
Lawliet_ZMZ
ACMERandNODER
展开
-
POJ 1797 最大运载量
Heavy Transportation Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 29430 Accepted: 7864 Description Background Hugo Heavy is happy. After the breakdown of原创 2016-08-03 15:20:24 · 320 阅读 · 0 评论 -
PAT天梯赛L2-001. 紧急救援 dijk经典最短路劲+点权最大+记录路径
L2-001. 紧急救援 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救援原创 2017-03-15 18:23:54 · 1016 阅读 · 0 评论 -
POJ1724 Dij队列优化邻接表
ROADS Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14737 Accepted: 5341 Description N cities named with numbers 1 ... N are connected with one-way roa原创 2017-04-12 19:12:48 · 857 阅读 · 0 评论 -
POJ 2502 Subway 关键在建图
Subway Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9718 Accepted: 3146 Description You have just moved from a quiet Waterloo neighbourhood to a big,原创 2017-04-14 18:36:58 · 463 阅读 · 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 · 461 阅读 · 0 评论 -
HDU 2680 有点坑的稠密图最短路(dij各版本)
Choose the best route Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 14431 Accepted Submission(s): 4711 Problem Description One原创 2017-05-03 14:36:49 · 406 阅读 · 0 评论 -
2017XDU初赛网络赛
问题 C: 大大数星星 时间限制: 1 Sec 内存限制: 128 MB 提交: 1928 解决: 655 [提交][状态][讨论版] 题目描述 喜欢数星星真是个传染病,这一天大大和大嫂晚上走在路上抬头看到很多星星,他们发现星星密密麻麻的布满了整个天空,大嫂说她想用线将天空的星星分割开,但是只给大大n根无限长的直线!大大为了让大嫂开心,想问问你最多能把星星分割成多少份!原创 2017-04-23 19:09:03 · 522 阅读 · 0 评论 -
XTU2016CCPC中南邀请赛C
Hamiltonian Path Accepted : 74 Submit : 189 Time Limit : 2000 MS Memory Limit : 65536 KB Hamiltonian Path In ICPCCamp, there are n cities and m direc原创 2017-04-27 21:39:54 · 646 阅读 · 0 评论 -
HDU 2017女生赛04 (变形最短路)
Deleting Edges Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 263 Accepted Submission(s): 85 Problem Description Little Q is原创 2017-05-10 03:01:45 · 498 阅读 · 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 · 18765 阅读 · 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 · 452 阅读 · 0 评论 -
3259 spfa判断负环(邻接表)
Wormholes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 44174 Accepted: 16235 Description While exploring his many farms, Farmer John has discovered a nu原创 2016-08-10 11:02:07 · 385 阅读 · 0 评论 -
POJ 2240 利率变权值 Floyd变乘法
Arbitrage Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20575 Accepted: 8768 Description Arbitrage is the use of discrepancies in currency exchange rates t原创 2016-08-03 21:08:48 · 529 阅读 · 0 评论 -
POJ 1062 坑爹的聘礼(枚举等级差选择性找边)
昂贵的聘礼 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 45367 Accepted: 13436 Description 年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。原创 2016-08-04 18:13:55 · 509 阅读 · 0 评论 -
POJ 2387 Bellman双重边
Til the Cows Come Home Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 44129 Accepted: 15001 Description Bessie is out in the field and wants to get back to the barn t原创 2016-08-05 10:00:59 · 460 阅读 · 0 评论 -
POJ 1511 SPFA+邻接矩阵 正图和反图相加
Invitation Cards Time Limit: 8000MS Memory Limit: 262144K Total Submissions: 25066 Accepted: 8277 Description In the age of television, not many people attend theater performance原创 2016-08-06 16:47:11 · 847 阅读 · 0 评论 -
POJ 2253 Floyd算法的巧妙改动
Frogger Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37130 Accepted: 11944 Description Freddy Frog is sitting on a stone in the middle of a lake. Suddenly原创 2016-08-03 10:38:22 · 297 阅读 · 0 评论 -
POJ 1125 可不可能遍历所有点情况下的最短路径
Stockbroker Grapevine Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 33859 Accepted: 18711 Description Stockbrokers are known to overreact to rumours. You h原创 2016-08-03 11:25:54 · 1125 阅读 · 0 评论 -
POJ 1860 Bellman改判断正环
Currency Exchange Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 26610 Accepted: 9842 Description Several currency exchange points are working in our city.原创 2016-08-06 15:19:40 · 578 阅读 · 0 评论 -
POJ 1122 反向建图Dijkstra+记录路径 输入格式坑
FDNY to the Rescue! Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 2897 Accepted: 887 Description The Fire Department of New York (FDNY) has always been proud of thei原创 2016-08-06 18:01:05 · 533 阅读 · 0 评论 -
POJ 1847 最短路径 垃圾水题可是坑爹多case问题初始化的锅
Tram Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 13527 Accepted: 4978 Description Tram network in Zagreb consists of a number of intersections and rails原创 2016-08-09 20:22:11 · 634 阅读 · 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 · 322 阅读 · 0 评论