
ACM_图论
文章平均质量分 88
77458
手敲仙盘键,目视星空棋,灵控比特力,逍遥虚空界。
展开
-
HDU 1254 推箱子 (BFS + DFS)
F - 推箱子Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription推箱子是一个很经典的游戏.今天我们来玩一个简单版本.在一个M*N的房间里有一个箱子和一个搬运工,搬运工的工作就是把箱子推到指定的位置,注意,搬运工原创 2016-07-12 15:37:41 · 894 阅读 · 0 评论 -
HDU - 3790最短路径问题经典模板题
HDU - 3790最短路径问题Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescription给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距原创 2015-08-04 20:56:56 · 925 阅读 · 0 评论 -
POJ - 1847Tram最短路
POJ - 1847TramTime Limit: 1000MS Memory Limit: 30000KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionTram network in Zagreb consists of a number of原创 2015-08-04 20:52:15 · 921 阅读 · 0 评论 -
POJ - 1062昂贵的聘礼最短路或者DFS
POJ - 1062昂贵的聘礼Time Limit: 1000MS Memory Limit: 10000KB 64bit IO Format: %I64d & %I64uSubmit StatusDescription年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他原创 2015-08-04 20:40:31 · 830 阅读 · 0 评论 -
HDU - 4360As long as Binbin loves Sangsang最短路问题多状态记录
HDU - 4360As long as Binbin loves SangsangTime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionBinbin misses Sangsan原创 2015-08-04 20:34:07 · 654 阅读 · 0 评论 -
线段树 + 扫描线加深详解
在线段树中的扫描线主要是解决矩形面积以及周长问题,比如下图让你求解所有矩形覆盖的面积和,或者是周长和,如果用寻常的方法,非常之麻烦,而且效率也不高,这里就会用到线段树的扫描线扫描线应对方案:由于题目提供的矩形比较多,坐标也很大,所以坐标需要离散化,可以按照题目要求或者自己的喜好,离散横坐标或者纵坐标都可以,这里讲的都是离散横坐标,不离散纵坐标假设原创 2015-08-14 11:17:42 · 4482 阅读 · 3 评论 -
The Pilots Brothers' refrigerator-DFS路径打印
I - The Pilots Brothers' refrigeratorTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThe game “The Pilots Brothers: followin原创 2015-07-22 20:23:05 · 583 阅读 · 0 评论 -
HDU 1255 覆盖的面积 (线段树 + 离散化 + 扫描线)
覆盖的面积Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4304 Accepted Submission(s): 2139Problem Description给定平面上若干矩形,求出被这些矩形覆盖原创 2015-08-14 10:33:20 · 2077 阅读 · 0 评论 -
UVA - 11354Bond最小生成树,LCA寻找最近公共祖先
/*Author: 2486Memory: 0 KB Time: 2222 MSLanguage: C++11 4.8.2 Result: AcceptedVJ RunId: 4236841 Real RunId: 15859210*/#include #include #include #include #include #include using namespa原创 2015-08-01 14:55:41 · 1368 阅读 · 0 评论 -
Tempter of the Bone-DFS剪枝
D - Tempter of the BoneTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1010DescriptionThe doggie found a bone in an ancient原创 2015-07-21 18:52:35 · 769 阅读 · 0 评论 -
HDU - 1875畅通工程再续-最小生成树
HDU - 1875畅通工程再续Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescription相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都原创 2015-07-31 19:03:57 · 878 阅读 · 0 评论 -
HDU 1542 Atlantis (线段树 + 扫描线 + 离散化)
AtlantisTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8998 Accepted Submission(s): 3856Problem DescriptionThere are several原创 2015-08-13 22:13:40 · 3843 阅读 · 5 评论 -
棋盘问题-DFS
C - 棋盘问题Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 1321Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放原创 2015-07-25 01:19:13 · 838 阅读 · 0 评论 -
第十一届湖南省省赛 - 简单的图论问题?(BFS)
简单的图论问题?题目描述给一个 n 行 m 列的迷宫,每个格子要么是障碍物要么是空地。每个空地里都有一个权值。你的任务是从找一条(r1,c1)到(r2,c2)的路径,使得经过的空地的权值之和最小。每一步可以往上下左右四个方向之一移动一格,但不能斜着移动,也不能移动到迷宫外面或者进入障碍物格子。 如下图,灰色格子代表障碍物。路径 A->B->D->F->E 的权值为原创 2015-09-01 16:47:24 · 1212 阅读 · 0 评论 -
HDU-1175 连连看(BFS 或 DFS)
连连看Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 29378 Accepted Submission(s): 7330Problem Description“连连看”相信很多人都玩过。没玩过也没原创 2016-07-12 09:57:26 · 718 阅读 · 2 评论 -
POJ - 3414 Pots(BFS)
PotsTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionYou are given two pots, having the volume of A and B liters r原创 2016-07-11 21:16:30 · 759 阅读 · 0 评论 -
HDU - bc - Xiao Ming climbing (优先队列)
Xiao Ming climbingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 853 Accepted Submission(s): 226Problem DescriptionDue to th原创 2015-09-16 11:58:47 · 505 阅读 · 0 评论 -
最小生成树的prim算法
/*作为一种算法prim算法是非常客观的,思维更是简单明了,我这里先说明一下prim算法的设计思路,首先是从一个无向图中随便找一个顶点当作一个起始点,原因很简单,便是对于一个最小生成树而言,他一定包括所有的点,那么以任意一个点为起点对最终的结果是没有什么影响的。如此,我们接下来就是如何去构造出一个最小生成树出来了,一个最简单明了的思路,也是与kruskal算法有点相似的一样的是原创 2015-11-04 15:35:19 · 630 阅读 · 0 评论 -
2015长春网络赛 1007 - The Water Problem(裸线段树)
The Water ProblemTime Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem DescriptionIn Land wate原创 2015-09-13 18:14:18 · 732 阅读 · 0 评论 -
HDU 2579 Dating with girls(2) (BFS)
Dating with girls(2)Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2416 Accepted Submission(s): 690Problem DescriptionIf you原创 2015-08-20 23:56:43 · 710 阅读 · 0 评论 -
HDU - 3584 Cube (三维树状数组 + 区间修改 + 单点求值)
HDU - 3584CubeTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionGiven an N*N*N cube A, whose elements are either原创 2015-08-08 19:11:23 · 1220 阅读 · 0 评论 -
HDU - 1247 Hat’s Words 字典树
HDU - 1247Hat’s WordsTime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionA hat’s word is a word in the dictionary t原创 2015-08-07 19:54:34 · 1149 阅读 · 0 评论 -
POJ - 2001Shortest Prefixes字典树记录
POJ - 2001Shortest PrefixesTime Limit: 1000MS Memory Limit: 30000KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionA prefix of a string is a substrin原创 2015-08-06 00:55:12 · 1187 阅读 · 0 评论 -
acmoj - 数蘑菇线段树区间更新
数蘑菇题目描述某土豪有许多种蘑菇的房子(编号从1到n,n输入描述输入首先是一个T,表示一共有T组数据下一行是一个n,代表土豪有几间房子下一行是n个整数数,代表从1到n每个房间开始蘑菇的大小(下一行是一个整数k(1后面跟着k行,每行三个整数q,l,r(1q表示土豪的操作,q为0的时候表示土豪给l到r这些房间里的蘑菇浇水,q为1的时候表示土豪想要知道原创 2015-08-05 21:42:55 · 1265 阅读 · 0 评论 -
Phone List
题目链接Phone ListTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11757 Accepted Submission(s): 3995Problem DescriptionGive原创 2015-03-06 18:13:59 · 658 阅读 · 0 评论 -
POJ - 1611The Suspects-并查集
POJ - 1611The SuspectsTime Limit: 1000MS Memory Limit: 20000KB 64bit IO Format: %I64d & %I64uSubmit StatusDescription严重急性呼吸系统综合症( SARS), 一种原因不明的非典型性肺炎,从2003年3原创 2015-07-31 18:56:45 · 952 阅读 · 0 评论 -
POJ - 3667 Hotel (线段树 + 区间合并)
POJ - 3667HotelTime Limit: 3000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionThe cows are journeying north to Thunder Bay i原创 2015-08-09 10:19:24 · 1727 阅读 · 0 评论 -
HDU - 1556 Color the ball (一维树状数组 + 区间修改 + 单点求值)
HDU - 1556Color the ballTime Limit: 3000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionN个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a原创 2015-08-08 19:26:18 · 822 阅读 · 0 评论 -
POJ - 3321 Apple Tree (线段树 + 建树 + 思维转换)
POJ - 3321Apple TreeTime Limit: 2000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionThere is an apple tree outside of kaka's原创 2015-08-09 15:48:07 · 1285 阅读 · 0 评论 -
HDU - 4287 Intelligent IME 字典树
HDU - 4287Intelligent IMETime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescription We all use cell phone today. And we原创 2015-08-07 20:12:47 · 1538 阅读 · 0 评论 -
POJ - 2155 Matrix (二维树状数组 + 区间修改 + 单点求值 或者 二维线段树 + 区间更新 + 单点求值)
POJ - 2155MatrixTime Limit: 3000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionGiven an N*N matrix A, whose elements are eit原创 2015-08-07 20:16:33 · 2117 阅读 · 0 评论 -
HDU - 1540 Tunnel Warfare 线段树 或者 让人心酸的暴力过
HDU - 1540Tunnel WarfareTime Limit: 2000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionDuring the War of Resistance Against Ja原创 2015-08-07 22:18:51 · 948 阅读 · 0 评论 -
HDU4499 - Cannon->DFS
G - CannonTime Limit:1000MS Memory Limit:65535KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 4499DescriptionIn Chinese Chess, there is one kind of powerful ch原创 2015-06-05 15:14:00 · 861 阅读 · 0 评论 -
Truck History
G - Truck HistoryTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionAdvanced Cargo Movement, Ltd. uses trucks of different types. Some tru原创 2015-05-13 15:23:27 · 703 阅读 · 0 评论 -
A Math game
A -A Math gameTime Limit: 2000/1000MS (Java/Others) Memory Limit:256000/128000KB (Java/Others)SubmitStatusProblem DescriptionRecently, Losanto find an interesting Math game. The原创 2015-05-11 11:06:00 · 764 阅读 · 0 评论 -
Rescue-优先队列
F - RescueTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1242DescriptionAngel was caught by the MOLIGPY! He was put in pri原创 2015-07-21 18:59:42 · 865 阅读 · 0 评论 -
POJ 1088 滑雪
滑雪Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 82291 Accepted: 30770DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等原创 2015-06-21 21:31:37 · 692 阅读 · 0 评论 -
HDU - 3460 Ancient Printer(字典树)
HDU - 3460Ancient PrinterTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionThe contest is beginning! While prepar原创 2015-08-09 11:25:37 · 1208 阅读 · 0 评论 -
Aizu - 2306 Rabbit Party (DFS图论)
G. Rabbit PartyTime Limit: 5000msCase Time Limit: 5000msMemory Limit: 65536KB64-bit integer IO format: %lld Java class name: MainSubmit Status PID: 39423Font Size: +原创 2015-08-24 20:47:27 · 809 阅读 · 0 评论 -
How Many Tables-并查集
HDU - 1213How Many TablesTime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionToday is Ignatius' birthday. He invite原创 2015-07-31 18:41:04 · 924 阅读 · 0 评论