随笔分类 -  最短路径

POJ-1502-MPI Maelstrom
摘要:问题描述 BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical c... 阅读全文

posted @ 2015-09-08 14:43 甜蜜蜜吖甜蜜蜜 阅读(163) 评论(0) 推荐(0)

POJ-3268-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 t... 阅读全文

posted @ 2015-09-08 09:54 甜蜜蜜吖甜蜜蜜 阅读(149) 评论(0) 推荐(0)

POJ-1125-Stockbroker Grapevine
摘要:问题描述 Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers... 阅读全文

posted @ 2015-09-07 20:04 甜蜜蜜吖甜蜜蜜 阅读(94) 评论(0) 推荐(0)

SPFA算法模板
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int inf=1 q;15 void add(int u,int v,int c)16 {17 pnt[e]=v;1... 阅读全文

posted @ 2015-09-07 14:36 甜蜜蜜吖甜蜜蜜 阅读(140) 评论(0) 推荐(0)

邻接表
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn=1100; 6 const int maxm=maxn*maxn/2; 7 int n,m; 8 int head[maxn],nxt[maxn],pn... 阅读全文

posted @ 2015-09-07 10:04 甜蜜蜜吖甜蜜蜜 阅读(165) 评论(0) 推荐(0)

POJ-2240-Arbitrage
摘要:问题描述 Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency... 阅读全文

posted @ 2015-09-06 12:03 甜蜜蜜吖甜蜜蜜 阅读(149) 评论(0) 推荐(0)

POJ-2387-Til the Cows Come Home
摘要:问题描述 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 milkin... 阅读全文

posted @ 2015-09-05 21:02 甜蜜蜜吖甜蜜蜜 阅读(132) 评论(0) 推荐(0)

hdu-1847-畅桶工程续
摘要:F - F 时限:1000MS 内存:32768KB 64位IO格式:%I64d & %I64u问题描述 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。... 阅读全文

posted @ 2015-09-05 20:01 甜蜜蜜吖甜蜜蜜 阅读(137) 评论(0) 推荐(0)

Floyd算法模板(多源最短)
摘要:1 /* 2 INPUT 3 4 5 7 12 6 1 2 24 7 1 3 8 8 1 4 15 9 2 5 610 3 5 711 3 6 312 4 7 413 5 7 914 6 5 215 6 7 316 6 4 517 7 2 318 19 520 1 221 3 622 1 72... 阅读全文

posted @ 2015-09-01 15:09 甜蜜蜜吖甜蜜蜜 阅读(136) 评论(0) 推荐(0)

Bellman算法模板
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 const int inf=1d[e[j].from]+e[j].c)27 {28 d[e[j].to]=d[e[j].fr... 阅读全文

posted @ 2015-09-01 10:16 甜蜜蜜吖甜蜜蜜 阅读(168) 评论(0) 推荐(0)

Dijkstra算法模板
摘要:#include #include #include using namespace std;const int inf=1d[j])//vis避免前面已经比过了的最小值的点重复比较 { //一直找出此时离起点最近的点,以此点为基础,向下找其他点到... 阅读全文

posted @ 2015-09-01 08:40 甜蜜蜜吖甜蜜蜜 阅读(253) 评论(3) 推荐(0)

导航