lca
文章平均质量分 80
eeeaaaaa
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU2586 How far away ?
How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5855 Accepted Submission(s): 2196 Problem Description There are n house原创 2014-10-06 20:49:13 · 428 阅读 · 0 评论 -
【总结】LCA小结
这些天一直在刷LCA的题目。。LCA的题目bing原创 2014-10-10 18:37:42 · 451 阅读 · 0 评论 -
ZOJ3195 Design the city
Design the city Time Limit: 1 Second Memory Limit: 32768 KB Cerror is the mayor of city HangZhou. As you may know, the traffic system of this city is so terrible, that there are traffic jams everywh原创 2014-10-04 10:01:22 · 516 阅读 · 0 评论 -
spoj Count on a tree【主席树】
题意:给一棵树还有一些询问求从u-v这条路径上点的权值的第K大。 我们可以从根开始维护主席树,就相当于以根为起点维护前缀和,这样我们可以求出u-v这条路径上对应点的权值,对u,v求一下lca(最近公共祖先),然后点的权值就是c[u]+c[v]-2*[lca(u,v)],然后同样二分找第k大。 #include #include #include #include using namespace原创 2015-06-27 17:10:43 · 504 阅读 · 0 评论
分享