图论
文章平均质量分 83
galesaur_wcy
我们一起加油啊~~~~
展开
-
C - MPI Maelstrom(最短路径)Dijkstra算法
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 advi原创 2017-08-01 13:54:11 · 278 阅读 · 0 评论 -
F - Arctic Network (最小生成树)
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 o原创 2017-08-03 13:48:59 · 352 阅读 · 0 评论 -
K - Swordfish(最小生成树)
There exists a world within our worldA world beneath what we call cyberspace. A world protected by firewalls, passwords and the most advanced security systems. In this world we hide our原创 2017-08-02 16:45:00 · 288 阅读 · 0 评论 -
J - QS Network(最小生成树)
Sunny Cup 2003 - Preliminary RoundApril 20th, 12:00 - 17:00 Problem E: QS NetworkIn the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each ot原创 2017-08-02 15:46:57 · 237 阅读 · 0 评论 -
H - Building a Space Station(最小生成树)
You 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 task.The sp原创 2017-08-01 14:05:04 · 216 阅读 · 0 评论 -
G - Networking (最小生成树)
You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect pairs of p原创 2017-08-01 14:03:43 · 225 阅读 · 0 评论 -
F - 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-08-01 09:16:58 · 280 阅读 · 0 评论 -
任务调度的合理性(拓扑排序)
7-14 任务调度的合理性(25 分)假定一个工程项目由一组子任务构成,子任务之间有的可以并行执行,有的必须在完成了其它一些子任务后才能执行。“任务调度”包括一组子任务、以及每个子任务可以执行所依赖的子任务集。比如完成一个专业的所有课程学习和毕业设计可以看成一个本科生要完成的一项工程,各门课程可以看成是子任务。有些课程可以同时开设,比如英语和C程序设计,它们没有必须先修哪门的约原创 2017-12-19 09:04:29 · 1567 阅读 · 0 评论 -
POJ - 1325(匈牙利算法最小点覆盖)
As we all know, machine scheduling is a very classical problem in computer science and has been studied for a very long history. Scheduling problems differ widely in the nature of the constraints that...原创 2018-04-11 19:57:46 · 275 阅读 · 0 评论 -
Borg Maze(POJ - 3026 )(BFS+最小生成树)
Borg Maze POJ - 3026 The Borg is an immensely powerful race of enhanced humanoids...原创 2018-04-30 13:34:21 · 269 阅读 · 0 评论 -
最小生成树 POJ - 3522(枚举边最小生成树)
G - 最小生成树 POJ - 3522 Given an undirected weighted graph G, y...原创 2018-04-30 18:39:17 · 146 阅读 · 0 评论 -
最短路 spfa算法
在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input 输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1...原创 2018-05-02 16:43:45 · 108 阅读 · 0 评论 -
POJ1679(次小生成树)
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...原创 2018-04-29 21:19:54 · 85 阅读 · 0 评论 -
Country Roads LightOJ 1002(最短路变形)
I am going to my home. There are many cities and many bi-directional roads between them. The cities are numbered from 0 to n-1 and each road has a cost. There are m roads. You are given the number of ...原创 2018-05-24 15:11:30 · 192 阅读 · 0 评论 -
1030 Travel Plan(30 分)(dij路径)
1030 Travel Plan(30 分)A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to de...转载 2018-08-30 20:12:42 · 418 阅读 · 0 评论 -
POJ1789(prim最小生成树)
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 tr...原创 2018-09-04 16:55:29 · 212 阅读 · 0 评论 -
A - Six Degrees of Cowvin Bacon POJ - 2139 最短路Floyd
实在是坑在输出这里wa了好几发注意是输出是整数整数整数的形式我至今不明为何The cows have been making movies lately, so they are ready to play a variant of the famous game "Six Degrees of Kevin Bacon".The game works like this原创 2017-12-08 18:09:31 · 151 阅读 · 0 评论 -
E - 确定比赛名次(拓补排序)
E - 确定比赛名次有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。Input 输入有若干组,每组中的第一行为二个数N(1<=N<=500),M;原创 2017-07-26 10:16:03 · 221 阅读 · 0 评论 -
A - 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 milking. Bessie needs her beauty sleep, so she wants to get b原创 2017-08-01 14:01:51 · 234 阅读 · 0 评论 -
D - 昂贵的聘礼(最短路径)
年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,转载 2017-08-02 14:47:33 · 212 阅读 · 0 评论 -
B - HDU Today(最短路径)
经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强。这时候,XHD夫妇也退居了二线,并在风景秀美的诸暨市浬浦镇陶姚村买了个房子,开始安度晚年了。这样住了一段时间,徐总对当地的交通还是不太了解。有时很郁闷,想去一个地方又不知道应该乘什么公交车,在什么地方转车,在什么地方下车(其实徐总自己有车,却一定转载 2017-08-02 14:48:23 · 578 阅读 · 0 评论 -
C - 一个人的旅行(最短路径)
虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大段时间,可不能浪费啊,一定要给自己好好的放个假转载 2017-08-02 20:19:53 · 608 阅读 · 0 评论 -
B - 最短路径问题
给你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时输入结束。(1Output 输出 一行有两个数,原创 2017-08-03 09:48:21 · 361 阅读 · 0 评论 -
A - 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 r原创 2017-08-03 12:30:20 · 456 阅读 · 0 评论 -
D - Idiomatic Phrases Game(最短路径)
Tom is playing a game called Idiomatic Phrases Game. An idiom consists of several Chinese characters and has a certain meaning. This game will give Tom two idioms. He should build a list of idioms and转载 2017-08-03 18:39:16 · 344 阅读 · 0 评论 -
C - How Many Maos Does the Guanxi Worth (dj+枚举每个人)最短路径
Problem Description"Guanxi" is a very important word in Chinese. It kind of means "relationship" or "contact". Guanxi can be based on friendship, but also can be built on money. So Chinese often say转载 2017-08-05 10:40:01 · 283 阅读 · 0 评论 -
D - 迷宫游戏 (最短路径)
你来到一个迷宫前。该迷宫由若干个房间组成,每个房间都有一个得分,第一次进入这个房间,你就可以得到这个分数。还有若干双向道路连结这些房间,你沿着这些道路从一个房间走到另外一个房间需要一些时间。游戏规定了你的起点和终点房间,你首要目标是从起点尽快到达终点,在满足首要目标的前提下,使得你的得分总和尽可能大。现在问题来了,给定房间、道路、分数、起点和终点等全部信息,你能计算在尽快离开迷宫的前提下,你的最大原创 2017-08-06 19:35:25 · 369 阅读 · 0 评论 -
六度分离 HDU - 1869 (最短路径)
1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six degrees of separation)。虽然米尔格兰姆的理论屡屡应验,一直也有很多社会学家对其兴趣浓厚,但是在30多年的时间转载 2017-08-06 20:44:46 · 203 阅读 · 0 评论 -
D - Frogger POJ - 2253
Freddy 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 of tourists' sun转载 2017-08-24 09:48:57 · 235 阅读 · 0 评论 -
最短路专题
原文转载来自http://blog.csdn.net/chenguolinblog/article/details/16870163第一题 hdu 1317 XYZZY点击打开hdu 1317思路:1 题目的图是一个有向图,并且可能存在环。第一个点的能量值为100,边的权值利用能量大小,例如2点为-60,如果1->2那么value[1][2] = -602 题目转载 2017-08-24 10:54:29 · 323 阅读 · 0 评论 -
最短路大大大跟着合集
题目转载来自此博客 http://my.csdn.net/acdreamers 跟着做嘿嘿持续更新1 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1874 思路:dj 是模板题 解题:#include#include#include#includeusing namespace std;int road[转载 2017-08-24 12:51:17 · 321 阅读 · 0 评论 -
F - 最短路 HDU - 2544(最短路的模板)
在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input 输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口是赛原创 2017-09-28 14:22:40 · 165 阅读 · 0 评论 -
G - Ordering Tasks(拓补排序)
G - Ordering Tasks题目:John has n tasks to do. Unfortunately, the tasks are not independent and the execution of one task is only possible if other tasks have already been executed.Input原创 2017-07-26 10:21:31 · 237 阅读 · 0 评论