
acm_图论
文章平均质量分 81
kongming_acm
kongming_acm
展开
-
hdu 4109 Instrction Arrangement 求关键路径的长度
Problem DescriptionAli has taken the Computer Organization and Architecture course this term. He learned that there may be dependence between instructions, like WAR (write after read), WAW, RAW.If原创 2011-10-31 12:34:58 · 1329 阅读 · 0 评论 -
poj 2253 Frogger 求从a到b路上的最大值中的最小值
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 p原创 2011-08-15 22:10:49 · 535 阅读 · 0 评论 -
poj 2263 Heavy Cargo 求a到b路上最小值中的最大值
DescriptionBig Johnsson Trucks Inc. is a company specialized in manufacturing big trucks. Their latest model, the Godzilla V12, is so big原创 2011-08-15 21:55:09 · 485 阅读 · 0 评论 -
poj 2240 Arbitrage 是否存在套率 Bellman-ford
DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of原创 2011-08-15 21:16:24 · 606 阅读 · 0 评论 -
poj 2570 Fiber Network 一直每条边可以通过某些公司过去,问从a到b可以通过那几个公司(同一个)过去
DescriptionSeveral startup companies have decided to build a better Internet, called the "FiberNet". They have already installed many node原创 2011-08-15 21:34:56 · 429 阅读 · 0 评论 -
hdu 3926 Hand in Hand 判断两个度最多是2的无向图是否同构
Problem DescriptionIn order to get rid of Conan, Kaitou KID disguises himself as a teacher in the kindergarten. He knows kids love games a原创 2011-08-13 22:30:33 · 997 阅读 · 0 评论 -
hdu 4034 Graph 已知最短路,求图中最少边数
Problem DescriptionEveryone knows how to calculate the shortest path in a directed graph. In fact, the opposite problem is also easy. Give原创 2011-09-13 17:21:59 · 594 阅读 · 0 评论 -
HDU 2121 Ice_cream’s world II 无固定根的最小树形图以及最小根
Problem DescriptionAfter awarded lands to ACMers, the queen want to choose a city be her capital. This is an important event in ice_crea原创 2011-09-05 17:04:59 · 594 阅读 · 0 评论 -
hdu 3873 Invade the Mars 有保护节点的最短路
Problem DescriptionIt's now the year 21XX,when the earth will explode soon.The evil U.S. decided to invade the Mars to save their lives.原创 2011-09-05 16:20:56 · 799 阅读 · 0 评论 -
hdu 4009 Transfer water 有固定根的最小树形图
Problem DescriptionXiaoA lives in a village. Last year flood rained the village. So they decide to move the whole village to the mountai原创 2011-09-04 13:45:41 · 591 阅读 · 0 评论 -
tju 2248 Channel Design 有固定根的最小树形图
We need irrigate our farms, but there is only one source of water nearby. So we need build some water channels with minimum cost.In Figu原创 2011-09-04 12:08:16 · 576 阅读 · 0 评论 -
poj 3164 Command Network 有固定根的最小树形图
DescriptionAfter a long lasting war on words, a war on arms finally breaks out between littleken’s and KnuthOcean’s kingdoms. A sudden原创 2011-09-04 12:02:35 · 572 阅读 · 0 评论 -
hdu 3896 Greatest TC 判断从a到b是否必须经过某点或某边
Problem DescriptionTC (Tian Chao) is magical place, as you all know...The railways and the rail-stations in TC are fragile and always原创 2011-08-01 09:45:37 · 1104 阅读 · 0 评论 -
poj 1330 树上LCA+RMQ
<br />#include<iostream><br />#include<cstring><br />#include<cmath><br />using namespace std;<br />const int N = 10005;<br />const int M =原创 2011-04-23 23:28:00 · 585 阅读 · 0 评论 -
joj 2737 狼与羊的故事 求任意两点之间的必经之路
村长要召开羊族大会,讨论羊族未来的发展,要求羊羊们到指定地点集合。小羊们收到通知后从家里出发到达指定地点。每个羊的家都是与其他羊的家连通的,可以互相访问。 比如说可以从1到3,同样也可以从3到1 。灰太郎听到这个消息后,准备有所行动(你懂的)。但他不知道应该在哪条路上等羊。但他知原创 2011-07-14 15:18:56 · 940 阅读 · 0 评论 -
joj 2607: Last time see you again 求1->n路上的必经之地(点)
大学的时光是值得怀念的,有多少事情珍藏在我们的记忆里,又有多少人我们一辈子都忘不掉。 123abc是一个不起眼的小男孩,他曾经在很多方面努力过,也经历了很多失败,在这些努力和失败中,他收获了自己的人生。 whx是123abc认识的一个女生,123abc很喜欢她,总是用各种方法想见原创 2011-07-18 13:57:48 · 952 阅读 · 0 评论 -
poj 3352 Road Construction 加入最少的边,使得无向图为一个双连通分支 没有重边
It's almost summer time, and that means that it's almost summer construction time! This year, the good people who are in charge of the roads原创 2011-07-08 11:01:46 · 928 阅读 · 0 评论 -
fzu 2038 2038 Another Postman Problem 在一棵树上求sigma sigma(i->j 距离)
Chinese Postman Problem is a very famous hard problem in graph theory. The problem is to find a shortest closed path or circuit that visits原创 2011-08-17 19:31:05 · 798 阅读 · 0 评论 -
hdu 3938 Portal 计算两点路上最大距离中的最小值<=L的路径个数 离线并查集
Problem DescriptionZLGG found a magic theory that the bigger banana the bigger banana peel .This important theory can help him make a po原创 2011-08-17 16:56:00 · 877 阅读 · 0 评论 -
2011 北京赛区 A bupt 238
//#include#include#include#include#include#includeusing namespace std;const int maxn=1100;struct Point{ double x,y; int peo;};int n;Point pi[maxn];doubl原创 2011-10-27 21:11:57 · 628 阅读 · 0 评论 -
poj 2296 Map Labeler 2-SAT+二分答案
DescriptionMap generation is a difficult task in cartography. A vital part of such task is automatic labeling of the cities in a map; where for each city there is text label to be attached to its lo原创 2011-10-19 20:39:37 · 949 阅读 · 0 评论 -
poj 2723 Get Luffy Out 2-SAT+二分答案
DescriptionRatish is a young man who always dreams of being a hero. One day his friend Luffy was caught by Pirate Arlong. Ratish set off at once to Arlong's island. When he got there, he found the s原创 2011-10-19 21:29:31 · 726 阅读 · 0 评论 -
hdu 3622 Bomb Game 2-SAT+二分答案 有N对点,求最大的半径R,使从每对点中选择一个点,且这N个点以自己为圆心,半径为R的圆两两不相交.(最大半径在所有半径相同情况下)
Problem DescriptionRobbie is playing an interesting computer game. The game field is an unbounded 2-dimensional region. There are N roun原创 2011-10-17 20:19:52 · 1015 阅读 · 0 评论 -
poj 3207 Ikki's Story 2-SAT
Descriptionliympanda, one of Ikki’s friend, likes playing games with Ikki. Today after minesweeping with Ikki and winning so many time原创 2011-10-17 21:32:47 · 462 阅读 · 0 评论 -
poj 3678 Katu Puzzle 2-SAT 有n个变量,每个可以取0或者1,再给出m组关系,每组关系都是两个变量进行运算可以得到的结果,运算有AND OR XOR三种,问能否满足这些关系,
DescriptionKatu Puzzle is presented as a directed graph G(V, E) with each edgee(a, b) labeled by a boolean operator op (one of AND,原创 2011-10-17 22:44:10 · 1058 阅读 · 0 评论 -
tarjan模板
tyvj 1111//自己模板//#include#include#include#includeusing namespace std;const int maxn=100000;int V,E;//点数(1) 边数str原创 2011-04-27 18:37:00 · 457 阅读 · 0 评论 -
poj 2404 Jogging Trails 求走最少距离使得所有边至少都遍历一次并回到原点(即sum+加上最少多少距离使得原图变成欧拉回路) FLOYD+状态压缩DP
DescriptionGord is training for a marathon. Behind his house is a park with a large network of jogging trails connecting water stations.原创 2011-10-03 21:01:53 · 1508 阅读 · 0 评论 -
hdu 1041 John's trip 输出欧拉回路
DescriptionLittle Johnny has got a new car. He decided to drive around the town to visit his friends. Johnny wanted to visit all his fri原创 2011-10-03 20:08:43 · 700 阅读 · 0 评论 -
poj 2337 Catenyms 判断并输出欧拉路 判断N个字符串是否能够首尾相连全部输出(欧拉路)
A catenym is a pair of words separated by a period such that the last letter of the first word is the same as the last letter of the second.原创 2011-03-30 20:29:00 · 758 阅读 · 0 评论 -
hdu 3440 House Man 差分约束
Problem DescriptionIn Fuzhou, there is a crazy super man. He can’t fly, but he could jump from housetop to housetop. Today he plans to use原创 2011-09-28 22:48:32 · 648 阅读 · 0 评论 -
zoj 2770 Burn the Linked Camp 差分约束
It is well known that, in the period of The Three Empires, Liu Bei, the emperor of the Shu Empire, was defeated by Lu Xun, a general of the原创 2011-09-28 23:05:52 · 738 阅读 · 0 评论 -
poj 1716 Integer Intervals 差分约束
Integer IntervalsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9285 Accepted: 3898DescriptionAn integer interval [a,原创 2011-07-06 11:18:23 · 498 阅读 · 0 评论 -
2414: Sightseeing tour 混合图欧拉回路+网络流
The city executive board in Lund wants to construct a sightseeing tour by bus in Lund, so that tourists can see every corner of the beautifu原创 2011-03-24 20:19:00 · 598 阅读 · 0 评论 -
poj 2472 106 miles to Chicago a->b有安全概率,求i->j安全概率最大的一条路
DescriptionIn the movie "Blues Brothers", the orphanage where Elwood and Jack were raised may be sold to the Board of Education if they do原创 2011-08-19 10:07:46 · 758 阅读 · 0 评论 -
zoj 2027 Travelling Fee 求a->b的最少花费(去除路上的最大花费后的费用)
Samball is going to travel in the coming vacation. Now it's time to make a plan. After choosing the destination city, the next step is to de原创 2011-08-19 09:54:17 · 578 阅读 · 0 评论 -
poj 3177 Redundant Paths 加入最少的边,使得无向图为一个双连通分支 有重边
In order to get from one of the F (1 Given a description of the current set of R (F-1 There might already be more than one paths between the原创 2011-07-08 11:12:49 · 596 阅读 · 0 评论 -
poj 3713 Transferring Sylla 判断无向图是否每两个点之间都能至少有3点不同的路径可达 是否3-连通
After recapturing Sylla, the Company plans to establish a new secure system, a transferring net! The new system is designed as follows:The C原创 2011-07-08 14:48:03 · 2061 阅读 · 0 评论 -
uestc 1558 Charitable Exchange 最少时间将价值交换到M以上 DP+线段树
DescriptionHave you ever heard a star charity show called Charitable Exchange? In this show, a famous star starts with a small item which va原创 2011-07-23 16:53:18 · 750 阅读 · 1 评论 -
Bellman_ford 模板
#include#include#include#includeusing namespace std;const int INF=(1struct Graph{ int s,t,w;//s->t=w;};Graph edge[5201];int dis[501];int V,E;//点数[1-n] 边数[0-E)bool bellman_ford(int s0)//原点{ for(int i=1;i dis[i]=INF; dis[s0]=0; for(int i=1;i原创 2011-03-16 20:29:00 · 479 阅读 · 0 评论 -
poj 1511 Invitation Cards SPFA
Invitation CardsTime Limit: 8000MS Memory Limit: 262144KTotal Submissions: 9544 Accepted: 3027DescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate原创 2011-03-16 21:58:00 · 594 阅读 · 0 评论