
最佳路径
u010660276
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
2010 Asia Regional Tianjin Site —— Online Contest (线段树二维转一维,2-SAT,floyed变形)hdu3621-3631
Bomb GameProblem DescriptionRobbie is playing an interesting computer game. The game field is an unbounded 2-dimensional region. There are N rounds in the game. At each round, the computer will give Ro原创 2015-09-07 21:50:15 · 1035 阅读 · 0 评论 -
最短路Codeforces E. Breaking Good
E. Breaking Good Breaking Good is a new video game which a lot of gamers want to have. There is a certain level in the game that is really difficult even for experienced gamers. Walter William原创 2015-01-24 18:58:51 · 659 阅读 · 0 评论 -
最短路打印路径SPFA(good)uva11374
ProblemD: Airport Express In a small city called Iokh, a train service, Airport-Express, takes residents to the airport more quickly than other transports. There are two types of trains in Airport-原创 2014-08-06 15:02:57 · 577 阅读 · 0 评论 -
有限制最短路hdu4179
Online Judge Online Exercise Online Teaching Online Contests Exercise Author F.A.Q Hand In Hand Online Acmers Forum | Discuss Statistical Charts Problem Archive Realtime Judge Statu原创 2014-08-18 20:05:28 · 912 阅读 · 0 评论 -
最短路SPFA+DP+uva10917
Problem C: A Walk Through the Forest Jimmy experiences a lot of stress at work these days, especially sincehis accident made working difficult. To relax after a hard day, helikes to walk home. To mak原创 2014-08-06 15:33:26 · 507 阅读 · 0 评论 -
最短路变形ural1934
D - Black Spot Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description Bootstrap: Jones's terrible leviathan will find you and drag the原创 2014-08-04 18:09:41 · 715 阅读 · 0 评论 -
Codeforces Round #257 (Div. 2)
A. Jzzhu and Children time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n children in Jzzhu's school. Jzzhu is原创 2014-07-26 22:51:45 · 465 阅读 · 0 评论 -
欧拉回路+floyd+uva117
输出欧拉回路或者欧拉路径长度,原创 2014-07-02 11:22:45 · 708 阅读 · 0 评论 -
floyd+并查集缩点
Description There are n countries at planet X on which Xiao Ming was born. Some countries, which have been sharing fine bilateral relations, form a coalition and thus all of their citizens w原创 2014-03-31 11:56:41 · 661 阅读 · 0 评论 -
floyed最短路+uva10803
距离小于10的可以走,距离大的初始化为INF,求最短路里最长的。 下面是代码: #include #include #include #include #include using namespace std; const double INF=100000000000; struct coord { int x,y; }down[105]; double grid[105][105]原创 2014-01-13 21:12:24 · 571 阅读 · 0 评论 -
SPFA判断负权回路+uva558
Wormholes In the year 2163, wormholes were discovered. A wormhole is a subspace tunnel through space and time connecting two star systems. Wormholes have a few peculiar properties: Worm原创 2013-12-22 12:53:13 · 705 阅读 · 0 评论 -
最短路+uva10986
非常裸的最短路。 下面是代码: #include #include #include #include using namespace std; const int MAX_M=50010; const int MAX_N=20010; const int INF=2000000000; struct node { int u,next,len; }edge[MAX_M*2]; int原创 2013-12-20 20:30:14 · 581 阅读 · 0 评论 -
bfs最短路+dp(FZU 2186)
Problem 2186 小明的迷宫 Accept: 45 Submit: 138 Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description 小明误入迷宫,塞翁失马焉知非福,原来在迷宫中还藏着一些财宝,小明想获得所有的财宝并离开迷宫。因为小明还是学生,还有家庭作业要做,所以他想尽快获得所原创 2015-03-23 17:11:47 · 592 阅读 · 0 评论 -
最短路+树分治(hdu4871多校联合)
Shortest-path tree Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 130712/130712 K (Java/Others) Total Submission(s): 840 Accepted Submission(s): 253 Problem Description Given a con原创 2015-04-12 11:02:31 · 602 阅读 · 0 评论 -
2015暑假训练(UVALive 5983 - 5992)线段树离线处理+dp+floyed最短路
A: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=83690#problem/A 题意:N*M的格子,从左上走到右下,要求在每个点的权值必须大于0,问起始的时候必须有多少能量 思路:二分答案#include<iostream> #include<cstdio> #include<string> #include<cstring> #原创 2015-08-19 19:39:23 · 730 阅读 · 2 评论 -
BFS最短路+状态dp(hdu3681)好
Prison BreakProblem DescriptionRompire is a robot kingdom and a lot of robots live there peacefully. But one day, the king of Rompire was captured by human beings. His thinking circuit was changed by h原创 2015-09-07 20:16:07 · 608 阅读 · 0 评论 -
2015 Multi-University Training Contest 6(hdu5353-5363)
欢迎参加——每周六晚的BestCoder(有米!) Average Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1748 Accepted Submission(s): 447 Special JudgeProblem原创 2015-08-09 10:43:58 · 548 阅读 · 0 评论 -
Codeforces Round #Pi (Div. 2)(最短路重建图+tarjan重边找桥)
C. Geometric ProgressionPolycarp loves geometric progressions very much. Since he was only three years old, he loves only the progressions of length three. He also has a favorite integer k and a sequen原创 2015-08-08 11:28:14 · 491 阅读 · 0 评论 -
Codeforces Round #Pi (Div. 2)(最短路重建图+tarjan重边找桥)
C. Geometric ProgressionPolycarp loves geometric progressions very much. Since he was only three years old, he loves only the progressions of length three. He also has a favorite integer k and a sequen原创 2015-08-08 11:27:03 · 563 阅读 · 0 评论 -
Dijkstra最短路模板(lrj)
感觉还是lrj的Dijkstra模板高端一些,准备一份struct Edge { int from,to,dist; Edge(int f=0,int t=0,int d=0):from(f),to(t),dist(d){} }; struct HeapNode//优先队列节点 { int d,u; HeapNode(int _d=0,int _u=0):d(_d),原创 2015-07-27 11:03:59 · 496 阅读 · 0 评论 -
hdu 5294 - Tricks Device(2015 Multi-University Training Contest 1 )最短路+网络流
Tricks DeviceProblem DescriptionInnocent Wu follows Dumb Zhang into a ancient tomb. Innocent Wu’s at the entrance of the tomb while Dumb Zhang’s at the end of it. The tomb is made up of many chambers,原创 2015-07-27 10:47:58 · 452 阅读 · 0 评论 -
2015百度之星复赛(hdu5258 - 5262)
数长方形 小度熊喜欢玩木棒。一天他在玩木棒的时候,发现一些木棒会形成长方形。小度熊可能是处女座吧,他只会将木棒横竖摆放,这样会形成很多长方形。现在给你一些横竖摆放的木棒,请你帮小度熊数一数形成了多少个长方形。 为了简化题目,一个木棒的端点不会在另一个木棒上,也就是说,木棒的端点不会在长方形上。 Input 第一行一个整数T,表示T组数据,不超过100组。原创 2015-06-12 17:50:26 · 1627 阅读 · 2 评论 -
Codeforces Round #303 (Div. 2)E. Paths and Trees 最短路
E. Paths and Trees Little girl Susie accidentally found her elder brother's notebook. She has many things to do, more important than solving problems, but she found this problem too interesting原创 2015-05-21 20:07:36 · 895 阅读 · 0 评论 -
Codeforces Round #302 (Div. 1)B. Destroying Roads 最短路
B. Destroying Roads In some country there are exactly n cities and m bidirectional roads connecting the cities. Cities are numbered with integers from 1 to n. If cities a and b are connected原创 2015-05-21 20:02:49 · 811 阅读 · 0 评论 -
树分治(hdu5016-2014西安现场赛)
Mart Master II Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 328 Accepted Submission(s): 108 Problem Description Trader Dogy live原创 2015-04-25 10:26:47 · 1373 阅读 · 0 评论 -
差分约束系统+SPFA/Bellman判断负权回路+uva515
转自:http://blog.youkuaiyun.com/pi9nc/article/details/12421417 差分约束系统: 如果一个系统由n个变量和m个约束条件组成,其中每个约束条件形如xj-xi 差分约束可以转化话单源最短路求解。因为单源最短路径满足三角不等式d[v] = 只要改变一下初始化条件即可。 差分约束题目有两种,一原创 2013-12-22 18:44:33 · 674 阅读 · 0 评论 -
差分约束系统+poj1201
Language: Default Intervals Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 19858 Accepted: 7509 Description You are given n closed, integer interval原创 2014-01-03 22:39:20 · 625 阅读 · 0 评论 -
二分图多重匹配+二分枚举-poj2112
Language: Default Optimal Milking Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 10381 Accepted: 3768 Case Time Limit: 1000MS Description FJ ha原创 2013-10-06 14:13:35 · 835 阅读 · 0 评论 -
最短路(Floyed)--poj2139
Language: Default Six Degrees of Cowvin Bacon Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2221 Accepted: 1036 Description The cows have been maki原创 2013-10-01 18:29:22 · 830 阅读 · 0 评论 -
次短路--poj3255
Language: Default Roadblocks Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 5726 Accepted: 2167 Description Bessie has moved to a small farm and som原创 2013-09-15 19:32:13 · 667 阅读 · 0 评论 -
最短路dijkstra--poj2502
网上说这道题属于基本题,但我觉得构图不好构,构完图就是裸的最短路。 最近老发迷糊,在细节上花太多时间,不是这犯点错,就是那犯点错,归结起来有些浮躁啊!给自己点冷水,静一静。 #include #include #include #include #include using namespace std; const int inf=1000000000; struct node { i原创 2013-08-18 17:08:40 · 705 阅读 · 0 评论 -
dijkstra--poj1797
Language: Default Heavy Transportation Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 17946 Accepted: 4733 Description Background Hugo Heavy is ha原创 2013-08-17 21:42:12 · 670 阅读 · 0 评论 -
bellman--poj1860
以为自己会写了,可写起来还是要看模板。。。真是很不熟,而且理解不到位啊,纠结了半天,本来想,只知道一种的本金,怎么比较啊,真是笨死了,bellman本来初始化就是都不知道,然后一步一步的逼近。。。。。。 还在double上wa了,细节啊! #include #include #include using namespace std; int N,M,S; double sum; //int原创 2013-08-17 20:45:13 · 564 阅读 · 0 评论 -
dijkstra最短路(个人感觉很好的题)--poj1062
转自点击打开链接 dijkstra算法是会写了,但这个题还是没做出来,不知道那个等级制度怎么用,人家的代码写的很详细! 每个物品看成一个节点,酋长的允诺也看作一个物品, 如果一个物品加上金币可以交换另一个物品, 则这两个节点之间有边,权值为金币数,求第一个节点到所有节点的最短路。 因为有等级限制,所以枚举每个点作为最低等级,选取符合所有符合等级限制的点 最短路问题,不转载 2013-08-17 17:05:21 · 772 阅读 · 0 评论 -
最短路--poj2387
Til the Cows Come Home Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 24926 Accepted: 8369 Description Bessie is out in the field and wants to get back to t原创 2013-08-13 19:00:18 · 637 阅读 · 0 评论 -
最短路(经典SPFA)-poj1511
Invitation Cards Time Limit: 8000MS Memory Limit: 262144K Total Submissions: 16938 Accepted: 5501 Description In the age of television, not many people attend theater p原创 2013-08-10 16:27:28 · 719 阅读 · 0 评论 -
最短路--floyed-warshall算法poj1125
比较简单的一道最短路,他要求所有的最短路中最小的,直接用floyed-warshall算法即可。 题意:有很多人传播谣言,给出每个人对其他人传播谣言的时间,求那个人传播给所有人后时间最短。 思路:简单的floyed-warshall算法,刚开始的时候初始化,出了点问题,初始化视情况而定。 #include #include #include #include #include using n原创 2013-08-10 09:15:22 · 988 阅读 · 0 评论 -
单源最短路(Dijkstra)-poj1502
题意:求从第一个人到其他所有人的传播的最短时间,可以同时传给很多人。 思路:Dijkstra算法求最短路,其中最大的就是需要的最小时间。 #include #include #include #include #include using namespace std; int map[110][110]; int dis[110]; int n; void dijstra() { bo原创 2013-08-10 13:29:56 · 742 阅读 · 0 评论 -
最佳路径算法总结
warshall算法: warshall算法是求二元关系穿闭包的算法.设关系R的关系图为G,设图G的所有顶点为v1,v2,…,vn,则t(R)的关系图可用该方法得到:若G中任意两顶点vi和vj之间有一条路径且没有vi到vj的弧,则在图G中增加一条从vi到vj的弧,将这样改造后的图记为G’,则G’即为t(R)的关系图。G’的邻接矩阵A应满足:若图G中存在从vi到vj路径,即vi与vj连通,则A[i原创 2013-08-08 20:47:54 · 9633 阅读 · 0 评论 -
最短路SPFA--poj3013
Language: Default Big Christmas Tree Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 19552 Accepted: 4196 Description Christmas is coming to KCM c原创 2013-10-29 23:01:05 · 618 阅读 · 0 评论