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): 2196Problem DescriptionThere are n house原创 2014-10-06 20:49:13 · 395 阅读 · 0 评论 -
【总结】LCA小结
这些天一直在刷LCA的题目。。LCA的题目bing原创 2014-10-10 18:37:42 · 406 阅读 · 0 评论 -
ZOJ3195 Design the city
Design the cityTime Limit: 1 Second Memory Limit: 32768 KBCerror 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 · 473 阅读 · 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#includeusing namespace原创 2015-06-27 17:10:43 · 464 阅读 · 0 评论