LCA
oopslb
这个作者很懒,什么都没留下…
展开
-
poj1470Closest Common Ancestors
Closest Common AncestorsTime Limit: 2000MS Memory Limit: 10000KTotal Submissions: 21497 Accepted: 6817DescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. For ...原创 2018-02-09 00:18:52 · 111 阅读 · 0 评论 -
EOJ Monthly 2018.8 D. Delivery Service (树上差分)
https://acm.ecnu.edu.cn/contest/103/problem/D/ 题意:给你n个点n-1条边和权值,q个起点和终点,你可以在询问前,无限次换边,然后求最小花费 思路:这个可以直接转化为每条边跑过几次,然经过多的边匹配小的权值就好,这就是树上差分问题了。不懂树上差分可以看这:https://www.cnblogs.com/ice-wing/p/...原创 2018-08-12 16:59:06 · 164 阅读 · 0 评论 -
poj3694Network
NetworkTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 11215 Accepted: 4152DescriptionA network administrator manages a large network. The network consists of N computers and M links between...原创 2018-03-18 17:24:03 · 190 阅读 · 0 评论 -
hdu3830Checkers
Checkers Time Limit : 2000/1000ms (Java/Other) Memory Limit : 125536/65536K (Java/Other)Total Submission(s) : 3 Accepted Submission(s) : 1Problem DescriptionLittle X, Little Y and Little Z are pla...原创 2018-03-18 17:08:30 · 238 阅读 · 0 评论 -
zoj3195Design 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 everyw...原创 2018-02-07 23:56:59 · 162 阅读 · 0 评论 -
poj1986Distance Queries
Distance QueriesTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 15329 Accepted: 5401Case Time Limit: 1000MSDescriptionFarmer John's cows refused to run in his marathon since he chose a path ...原创 2018-02-07 23:52:30 · 150 阅读 · 0 评论 -
hdu3078Network
NetworkTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1591 Accepted Submission(s): 709Problem DescriptionThe ALPC company is now原创 2018-02-07 20:34:26 · 168 阅读 · 0 评论 -
hdu2874Connections between cities
Connections between citiesTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12894 Accepted Submission(s): 2977Problem DescriptionA原创 2018-02-07 20:31:37 · 139 阅读 · 0 评论 -
hdu2586How far away ?
How far away ?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 19879 Accepted Submission(s): 7786Problem DescriptionThere are n ho原创 2018-02-07 20:28:30 · 105 阅读 · 0 评论 -
hdu4547
CD操作Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2637 Accepted Submission(s): 724Problem Description 在Windows下我们可以通过cmd运行DOS原创 2018-02-07 20:26:19 · 159 阅读 · 0 评论 -
hdu4409Family Name List
Family Name ListTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1313 Accepted Submission(s): 435Problem DescriptionKong belongs t原创 2018-02-07 20:21:43 · 200 阅读 · 0 评论 -
poj1330Nearest Common Ancestors
Nearest Common AncestorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 31988 Accepted: 16288DescriptionA rooted tree is a well-known data structure in computer science and engineering. An e...原创 2018-02-09 00:20:45 · 108 阅读 · 0 评论 -
hdu 5452 Minimum Cut (LCA+DFS)
http://acm.hdu.edu.cn/showproblem.php?pid=5452 题意:一张图G中有一颗生成树T,问最少删除多少条边能使得图不连通,删除的边中必须有且仅有一条包含生成树T中的边。 思路:如果一条边不属于生成树T,那么对于和 来说它连接到其他子树的贡献是1,因此需要num[u]++, num[v]++; 但是这样就多算了(u,v)都在同...原创 2018-08-16 21:09:10 · 107 阅读 · 0 评论