图论
gaoxiang36999
这个作者很懒,什么都没留下…
展开
-
POJ 1330 最近公共祖先LCA(Tarjan离线做法)
题目链接:http://poj.org/problem?id=1330 题目大意十分明了简单,就是给定一棵树,求某两个子节点的最近公共祖先,如果尚不清楚LCA的同学,可以左转百度等进行学习。 稍微需要注意的是,建树顺序需要按照题目给定的顺序进行,也就是说根被设定成第一个给出的结点,如样例2。 此题网上题解颇多,但是多是使用的邻接表存图,于是我这里采用了边表,不过实质上Tarjan的部分思想都原创 2015-05-07 10:45:00 · 561 阅读 · 0 评论 -
hihoCoder 1167高等理论计算机科学(LCA)
clj在某场hihoCoder比赛中的一道题,表示clj的数学题实在6,这道图论貌似还算可以。。。 题目链接:http://hihocoder.com/problemset/problem/1167 由于是中文题目,题意不再赘述。 对于任意两条小精灵的活动路径a和b,二者相交的判断条件为b的两个端点的LCA在a的路径上;那么我们可以首先将每个活动路径端点的LCA离线预处理出来,对每个节点LC原创 2015-05-07 11:05:50 · 725 阅读 · 0 评论 -
Gym 100703A Tea-drinking 最小生成树
A. Tea-drinking time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Castles Valley was lit by the noonday sun.原创 2015-07-27 19:10:58 · 503 阅读 · 0 评论 -
hdu 5348 MZL's endless loop 欧拉回路
MZL's endless loop Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1502 Accepted Submission(s): 331 Special Judge Problem Descript原创 2015-08-05 17:23:29 · 497 阅读 · 0 评论 -
Gym 100685 G Gadget Hackwrench LCA+DFS标记
G. Gadget Hackwrench time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output Chip 'n' Dale rescue rangers! But obser原创 2015-10-04 20:20:56 · 762 阅读 · 0 评论 -
Aizu Usoperanto 拓扑+贪心
Usoperanto Usoperanto is an artificial spoken language designed and regulated by Usoperanto Academy. The academy is now in study to establish Strict Usoperanto, a variation of the language intend原创 2015-10-04 20:45:57 · 546 阅读 · 0 评论 -
poj 2186 强连通分量Tarjan
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 27786 Accepted: 11192 Description Every cow's dream is to become the most popular cow in the原创 2015-10-13 21:44:58 · 385 阅读 · 0 评论