
图论
西瓜君wtml
这个作者很懒,什么都没留下…
展开
-
poj 3255 求次短路路径
DescriptionBessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery along th原创 2017-09-06 16:16:31 · 227 阅读 · 0 评论 -
O - Extended Traffic(SPFA判负环)
Dhaka city is getting crowded and noisy day by day. Certain roads always remain blocked in congestion. In order to convince people avoid shortest routes, and hence the crowded roads, to reach destinati原创 2017-11-17 13:01:51 · 402 阅读 · 0 评论 -
N - Tram(Floyd算法)
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 intersection. W原创 2017-11-13 15:42:29 · 271 阅读 · 0 评论 -
hdu 4725(Dijkstra算法)
Problem Description This is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algoritmo. If you do not understand a word of t原创 2017-11-18 12:41:46 · 746 阅读 · 0 评论 -
A - Jungle Roads
The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so原创 2017-11-19 16:05:11 · 200 阅读 · 0 评论 -
D - 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-11-05 19:14:37 · 232 阅读 · 0 评论 -
G - Arctic Network(最小生成树的第K大边)
The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every ou原创 2017-11-30 21:43:57 · 331 阅读 · 1 评论 -
K - The Unique MST(次小生成树)
Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of G原创 2017-12-03 18:54:03 · 300 阅读 · 0 评论 -
F - Truck History(最小生成树)
Advanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing each type of a tru原创 2017-12-07 11:10:49 · 568 阅读 · 0 评论 -
B - Network (Tarjan求割点)
A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N. No two places have the same number. The lines are bi原创 2018-02-05 22:44:02 · 275 阅读 · 0 评论 -
hdu 1217 Floyed
题意:在每种钱币间进行各种交换,最后换回自己如果能赚,那么就Yes,否则No注意应为有负权所以dijsktra在这里行不通了可以用spfa,Floyed算法. map标记字符串,map的强大代码:#include <iostream>#include <cstdio>#include <algorithm>#include <map>using namespace std;map<stri原创 2018-03-11 19:39:02 · 141 阅读 · 0 评论 -
hdu 3549 最大流模板题
Problem Description Network flow is a well-known difficult problem for ACMers. Given a graph, your task is to find out the maximum flow for the weighted directed graph.Input The first line of input c原创 2018-02-25 22:17:56 · 303 阅读 · 0 评论 -
L - Subway
You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don’t want t原创 2017-11-12 21:29:59 · 255 阅读 · 0 评论 -
K - Candies(Dijkstra差分约束)
During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the原创 2017-11-11 19:57:02 · 507 阅读 · 0 评论 -
J - Invitation Cards(Dijkstra+Heap)
In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They h原创 2017-11-11 13:12:29 · 252 阅读 · 0 评论 -
hdu 2544 Dijkstra算法
Problem Description 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input 输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在原创 2017-08-29 08:57:06 · 244 阅读 · 0 评论 -
hdu 1874 dijkstra算法
Problem Description 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input 本题目包含多组数据,请处理到文件结束。 每组数据第一行包含两个正整数N和M(0题原创 2017-09-01 11:09:12 · 211 阅读 · 0 评论 -
kuangbin 最短路练习 A题
DescriptionBessie 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 want原创 2017-09-08 18:14:03 · 252 阅读 · 0 评论 -
hdu 2066 dijkstra
Problem Description 虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大段时间原创 2017-09-01 10:16:43 · 209 阅读 · 0 评论 -
hdu 3790 最短路径问题
Problem Description 给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input 输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。 (1题解:参考原创 2017-09-01 10:39:44 · 179 阅读 · 0 评论 -
E - Currency Exchange Bellman-ford算法
Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these currencies. There can原创 2017-11-07 14:56:32 · 259 阅读 · 0 评论 -
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 there really is a way from the place his cus原创 2017-10-30 16:23:45 · 450 阅读 · 0 评论 -
F - Wormholes(Bellmanford判负环)
While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that is原创 2017-11-08 20:40:20 · 278 阅读 · 0 评论 -
G - MPI Maelstrom
BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee’s research advis原创 2017-11-09 17:55:40 · 333 阅读 · 0 评论 -
H - Cow Contest(Floyd算法传递闭包)
N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is uni原创 2017-11-09 19:36:48 · 350 阅读 · 0 评论 -
I - Arbitrage(Bellman-Ford算法判正环)
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. For example, suppose that 1 US Dollar buys 0.5 British原创 2017-11-10 15:30:24 · 399 阅读 · 0 评论 -
hdu 1532 最大流模板题
Problem Description Every time it rains on Farmer John’s fields, a pond forms over Bessie’s favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time原创 2018-03-13 15:22:46 · 255 阅读 · 0 评论