![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索&图论
AC_Lee
这个作者很懒,什么都没留下…
展开
-
hdu 3268 最短路 建模+细节
题目:http://icpc.njust.edu.cn/Problem/Hdu/3268/代码://#include#include #include #include #include #include //toloewr()#include #include #include // cout<<setprecision(1)<<fixed原创 2017-10-21 23:31:37 · 354 阅读 · 0 评论 -
链式前向星初探
参自:http://www.voidcn.com/blog/xiaotan1314/article/p-5980996.htmlhttp://blog.csdn.net/acdreamers/article/details/16902023本质:用数组来模拟链表,实现图的邻接表存储。兼具邻接矩阵的实现复杂度与邻接表的空间复杂度。(应该是比vector 邻接表要快一些)原创 2017-06-26 16:06:58 · 335 阅读 · 0 评论 -
hdu 6029 图论思维题 咋一看还以为是一般图匹配
题目:Graph TheoryTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 448 Accepted Submission(s): 216Problem DescriptionLitt原创 2017-06-25 22:30:00 · 306 阅读 · 0 评论 -
hdu 6026 最短路变形+删边构造树的方案数
题目:Deleting EdgesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 548 Accepted Submission(s): 198Problem DescriptionLi原创 2017-06-25 17:49:26 · 354 阅读 · 0 评论 -
poj 3255 次短路+dijkstra+挑战模板
题目:RoadblocksTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 14688 Accepted: 5163DescriptionBessie has moved to a small farm and sometimes enjoy原创 2017-06-22 21:03:20 · 229 阅读 · 0 评论 -
codeforces 574B 暴力+复杂度分析
题目:B. Bear and Three Musketeerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDo you know原创 2017-06-22 00:35:06 · 286 阅读 · 0 评论 -
codeforces 755c 并查集+迷之题意....
题目:C. PolandBall and Foresttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolandBall lives in a fore原创 2017-06-21 23:00:24 · 252 阅读 · 0 评论 -
hdu 3718 二分图最佳匹配 占坑待补
题目:SimilarityTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2160 Accepted Submission(s): 868Problem DescriptionWhen we原创 2017-06-30 22:53:52 · 323 阅读 · 0 评论 -
codeforces 771a 完全图+并查集判连通块中的点数和边数
题目:A. Bear and Friendship Conditiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputBear Limak examine原创 2017-06-21 21:30:18 · 541 阅读 · 0 评论 -
codefroces 601A 题意唬人的最短路
题意:A. The Two Routestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn Absurdistan, there原创 2017-06-21 20:30:20 · 210 阅读 · 0 评论 -
hdu 2813 二分图最大权匹配 非完全匹配
题目:One fihgt oneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2657 Accepted Submission(s): 851Problem DescriptionLv B原创 2017-06-30 21:24:17 · 644 阅读 · 0 评论 -
hdu 2255 二分图最大权匹配 KM算法kuangbin模板
题目:奔小康赚大钱Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9445 Accepted Submission(s): 4161Problem Description传说在遥远的地方有一原创 2017-06-30 20:10:34 · 680 阅读 · 0 评论 -
hdu 4421 && zoj 3656 Bit Magic 2-sat题找规律水过 也可以用并查集
题目:Bit MagicTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3500 Accepted Submission(s): 980Problem DescriptionYesterda原创 2017-06-28 23:11:09 · 311 阅读 · 0 评论 -
poj 2631 树的直径裸题 注意设置n
题目:Roads in the NorthTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2893 Accepted: 1414DescriptionBuilding and maintaining roads among communit原创 2017-06-26 17:32:53 · 206 阅读 · 0 评论 -
poj 1849 树的直径+思维
题目:TwoTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 1554 Accepted: 803DescriptionThe city consists of intersections and streets that connect t原创 2017-06-26 19:07:38 · 297 阅读 · 0 评论 -
poj 1985 树的直径模板题
题目:Cow MarathonTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 5325 Accepted: 2614Case Time Limit: 1000MSDescriptionAfter hearing about th原创 2017-06-26 17:18:39 · 558 阅读 · 0 评论 -
poj 2186 DAG+缩点+tarjan模板 (模板待消化
题目:Popular CowsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 33895 Accepted: 13803DescriptionEvery cow's dream is to become the most popular cow i原创 2017-06-27 20:50:52 · 451 阅读 · 0 评论 -
hdu 3715 2-sat + 二分
题目:Go DeeperTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3171 Accepted Submission(s): 1032Problem DescriptionHere is原创 2017-08-20 20:43:50 · 342 阅读 · 0 评论 -
hdu 1272 判断是否为一棵无向树
题目:小希的迷宫Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 51962 Accepted Submission(s): 16210Problem Description上次Gardon的原创 2017-07-21 15:01:25 · 505 阅读 · 0 评论 -
hdu 5889 最短路+裸最小割
题目:BarricadeTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1646 Accepted Submission(s): 490Problem DescriptionThe empi原创 2017-07-26 21:41:42 · 275 阅读 · 0 评论 -
hdu 3691 全局最小割模板题 + 一点学习记录
题目:Nubulsa ExpoTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1230 Accepted Submission(s): 570Problem DescriptionYou原创 2017-03-10 22:32:42 · 340 阅读 · 0 评论 -
hdu 6031 两集合间最大LCA
题目:Innumerable AncestorsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 598 Accepted Submission(s): 188Problem Descripti原创 2017-06-25 21:40:44 · 367 阅读 · 0 评论 -
poj 1679 次小生成树
题目:代码:#include#include#include#includeusing namespace std;const int maxn = 1010;const int maxm = 100010;const int inf=0x7f7f7f7f;int n,m,t;struct edge{ int from,to,w; bo原创 2017-08-02 16:53:44 · 205 阅读 · 0 评论 -
poj 2831次小生成树变形
题目:Can We Build This One?Time Limit: 5000MS Memory Limit: 65536KTotal Submissions: 1671 Accepted: 630Case Time Limit: 2000MSDescription“Highways are原创 2017-08-02 19:36:49 · 219 阅读 · 0 评论 -
zoj 3005 矩形覆盖 + 搜索
题目:Bacteria ColonyTime Limit: 2 Seconds Memory Limit: 65536 KBThe biologist Mr.R likes cultivating bacteria on the culture medium. What is interesting is that the new cultivated原创 2017-08-16 12:42:37 · 226 阅读 · 0 评论 -
poj 1182 食物链 并查集
题目:食物链Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 74074 Accepted: 21994Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以原创 2017-07-20 17:15:31 · 237 阅读 · 0 评论 -
poj 3678 2SAT+挑战板子
题目:Katu PuzzleTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10066 Accepted: 3768DescriptionKatu Puzzle is presented as a directed graph G(V, E原创 2017-07-29 23:33:44 · 444 阅读 · 0 评论 -
poj 3683 2SAT入门+挑战模板
题目:Priest John's Busiest DayTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 10115 Accepted: 3462 Special JudgeDescriptionJohn is the only pr原创 2017-07-29 18:01:31 · 336 阅读 · 0 评论 -
hdu 4424 并查集+分治/贪心 有些最大生成树的感觉
题目:给一棵树 要求选一个点,使得其他所有点到该点的路径上所经过边的最小值的和最大 分析:暴力模拟会T。一开始以为是要用树的直径(大佬们想的都是树形DP...) 中心点应该是在直径上 但是并不能确定这个点,如果整棵树本来就是一个链,极端情况有200000个点,这种情况就不知道该怎么处理了 事实上从找中心点开始不好切入,可以从边的角度考虑。最终目的相当于从给出的N-1条边原创 2017-06-28 17:37:37 · 490 阅读 · 0 评论 -
codeforces 20 c 堆优化dijkstra + 路径打印
题目:C. Dijkstra?time limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputYou are given a weighted undirected gra原创 2017-05-21 11:26:59 · 483 阅读 · 0 评论 -
hdu 3572 Task Schedule 最大流+建图+dinic入门
题目:Task ScheduleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7665 Accepted Submission(s): 2356Problem DescriptionOur原创 2016-11-24 22:23:48 · 247 阅读 · 0 评论 -
poj 2253 floyd变形
题目:FroggerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 38692 Accepted: 12460DescriptionFreddy Frog is sitting on a stone in the middle of a l原创 2016-10-20 21:00:30 · 209 阅读 · 0 评论 -
最大流入门 poj 1273 && hdu 3549
poj 1273:#include#include#include //tower()#include #include #include#include// cout<<setprecision(1)<<fixed<<a;#include #include #include //assert#include #include#include原创 2016-11-09 21:16:51 · 287 阅读 · 0 评论 -
poj 1502 MPI Maelstrom 单源最短路+dijkstra算法
题目:MPI MaelstromTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 8659 Accepted: 5335DescriptionBIT has recently taken delivery of their new super原创 2016-10-18 20:18:13 · 278 阅读 · 0 评论 -
poj 1860 正权回路+Bellman
题目:Currency ExchangeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 27473 Accepted: 10187DescriptionSeveral currency exchange points are working原创 2016-10-27 23:05:03 · 221 阅读 · 0 评论 -
poj 1511 最短路数据加强版 dijkstra堆优化
题目:Invitation CardsTime Limit: 8000MS Memory Limit: 262144KTotal Submissions: 25964 Accepted: 8623DescriptionIn the age of television, not many people att原创 2016-10-27 22:04:59 · 444 阅读 · 0 评论 -
poj 3259 负权回路+Bellman
题目:WormholesTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 45714 Accepted: 16874DescriptionWhile exploring his many farms, Farmer John has disc原创 2016-10-27 19:00:51 · 221 阅读 · 0 评论 -
poj 2240 最长路变形 Floyd改写
题目:ArbitrageTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 21468 Accepted: 9153DescriptionArbitrage is the use of discrepancies in currency exc原创 2016-10-26 21:09:48 · 231 阅读 · 0 评论 -
poj 1797 路径问题 dijkstra改写
题目:分析:代码:1.Floyd算法TLE#include #include #include #include #include #include #include using namespace std;const int maxn=1009;const int inf=100000000;int n,m,t;int fl原创 2016-10-26 19:02:55 · 283 阅读 · 0 评论 -
poj 1125 floyd算法求最短路
题目:Stockbroker GrapevineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 34641 Accepted: 19201DescriptionStockbrokers are known to overreact to r原创 2016-10-16 19:57:24 · 239 阅读 · 0 评论