
---------------图算法------------
文章平均质量分 79
IF_I
这个作者很懒,什么都没留下…
展开
-
AOE网上的关键路径【OJ--2498】【SPFA】
题目描述 一个无环的有向图称为无环图(Directed Acyclic Graph),简称DAG图。 AOE(Activity On Edge)网:顾名思义,用边表示活动的网,当然它也是DAG。与AOV不同,活动都表示在了边上,如下图所示: 如上所示,共有1原创 2015-12-04 19:34:41 · 744 阅读 · 0 评论 -
Antenna Placement(POJ--3020
DescriptionThe Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most striking reason why they got the job, is their dis原创 2015-08-24 20:32:47 · 533 阅读 · 0 评论 -
Asteroids(POJ--3041 【二分图的最小顶点集 = 二分图的最大匹配】
DescriptionBessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K Fortunately, Bessi原创 2015-08-24 17:21:28 · 357 阅读 · 0 评论 -
ACM Computer Factory(POJ--3436
DescriptionAs you know, all the computers used for ACM contests must be identical, so the participants compete on equal terms. That is why all these computers are historically produced at the same原创 2015-08-24 10:30:21 · 233 阅读 · 0 评论 -
F题【LightOJ 1002】【dijkstra】
DescriptionI am going to my home. There are many cities and many bi-directional roads between them. The cities are numbered from0 to n-1 and each road has a cost. There are m roads. You are given原创 2015-08-08 20:30:20 · 472 阅读 · 0 评论 -
Truck History 【POJ--1789】【普里姆&&克鲁斯卡尔】【邻接矩阵】
DescriptionAdvanced 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 ea原创 2015-08-10 14:38:53 · 300 阅读 · 0 评论 -
Highways【POJ--2485】【普里姆】【邻接矩阵】
DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this probl原创 2015-08-10 15:03:50 · 371 阅读 · 0 评论 -
Borg Maze【POJ--3026】【并查集】
DescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg原创 2015-08-10 21:19:20 · 415 阅读 · 0 评论 -
Arbitrage【POJ--2240】【SPFA】
DescriptionArbitrage 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原创 2015-08-10 10:48:58 · 301 阅读 · 0 评论 -
Stockbroker Grapevine【POJ--1125】【Floyd】
DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge原创 2015-08-10 09:02:49 · 361 阅读 · 0 评论 -
Fox And Names
A B C DD - DTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionFox Ciel is going to publish a paper on FOCS (Foxes Operated原创 2015-02-04 20:48:16 · 350 阅读 · 0 评论 -
图结构练习——判断给定图是否存在合法拓扑序列
题目描述 给定一个有向图,判断该有向图是否存在一个合法的拓扑序列。输入 输入包含多组,每组格式如下。第一行包含两个整数n,m,分别代表该有向图的顶点数和边数。(n后面m行每行两个整数a b,表示从a到b有一条有向边。 输出 若给定有向图存在合法拓扑序列,则输出YES;否则输出NO。 示例输入1 02 21 22 1原创 2015-07-25 13:44:41 · 409 阅读 · 0 评论 -
图结构练习——判断给定图是否存在合法拓扑序列
题目描述 给定一个有向图,判断该有向图是否存在一个合法的拓扑序列。输入 输入包含多组,每组格式如下。第一行包含两个整数n,m,分别代表该有向图的顶点数和边数。(n后面m行每行两个整数a b,表示从a到b有一条有向边。 输出 若给定有向图存在合法拓扑序列,则输出YES;否则输出NO。 示例输入1 02 21 22 1原创 2015-07-27 14:40:03 · 548 阅读 · 0 评论 -
Frogger(POJ--2253
DescriptionFreddy 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 o原创 2015-08-04 10:49:55 · 277 阅读 · 0 评论 -
昂贵的聘礼(POJ--1062
Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换原创 2015-08-04 09:00:37 · 289 阅读 · 0 评论 -
Wormholes(POJ--3259
DescriptionWhile 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 a原创 2015-08-03 21:19:34 · 265 阅读 · 0 评论 -
用最基本的弗洛伊德算法求1到n的最短路径
#include #include #define maxnum 1000#define maxint 0x3f3f3f3fint map[maxnum][maxnum];int n,m;void Floyd() //弗洛伊德算法{ int k,i,j; for(k=1; k<=n; k++)原创 2015-02-05 17:14:29 · 998 阅读 · 0 评论 -
Layout
A B C DD - DTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionLike everyone else, cows like to stand close to their friends原创 2015-02-05 16:14:55 · 244 阅读 · 0 评论 -
Building a Space Station(POJ--2031【最小生成树】
DescriptionYou are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the原创 2015-08-27 19:28:44 · 275 阅读 · 0 评论 -
图结构练习——最小生成树
题目描述 有n个城市,其中有些城市之间可以修建公路,修建不同的公路费用是不同的。现在我们想知道,最少花多少钱修公路可以将所有的城市连在一起,使在任意一城市出发,可以到达其他任意的城市。 输入 输入包含多组数据,格式如下。第一行包括两个整数n m,代表城市个数和可以修建的公路个数。(n 剩下m行每行3个正整数a b c,代表城市a 和城市b之间可以修建一条公路,代原创 2015-07-27 15:27:45 · 510 阅读 · 0 评论 -
Labeling Balls(POJ--3687
DescriptionWindy has N balls of distinct weights from 1 unit to N units. Now he tries to label them with 1 to N in such a way that:No two balls share the same label.The labeling satisfies seve原创 2015-08-11 08:49:54 · 310 阅读 · 0 评论 -
Sorting It All Out(POJ--1094
DescriptionAn ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequenc原创 2015-08-10 19:00:18 · 290 阅读 · 0 评论 -
Currency Exchange【POJ--1860】【SPFA】
DescriptionSeveral 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 curren原创 2015-08-03 19:53:14 · 308 阅读 · 0 评论