
树形dp
Kirito_Acmer
这个作者很懒,什么都没留下…
展开
-
hdu2196 Compute
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4646 Accepted Submission(s): 2345Problem DescriptionA school bought the first c原创 2015-10-21 21:38:56 · 512 阅读 · 0 评论 -
hdu4126Genghis Khan the Conqueror (最小生成树+树形dp)
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 327680/327680 K (Java/Others)Total Submission(s): 2524 Accepted Submission(s): 760Problem DescriptionGenghis Khan(成吉思汗)(1162-1原创 2016-09-22 17:17:50 · 824 阅读 · 0 评论 -
hdu1561 The more, The Better
Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6527 Accepted Submission(s): 3836Problem DescriptionACboy很喜欢玩一种战略游戏,在一个地图上,有N座城原创 2015-10-24 18:26:49 · 521 阅读 · 0 评论 -
poj2486 Apple Tree
Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8672 Accepted: 2884DescriptionWshxzt is a lovely girl. She likes apple very much. One day HX takes her to an apple原创 2015-10-30 20:32:30 · 573 阅读 · 0 评论 -
uva10859 Placing Lampposts (树形dp+求两者最小值方法)
题目链接:点击打开链接题意:给你一个n个点m条边的无向无环图,在尽量少的节点上放灯,使得所有边都被照亮,每盏灯将照亮以它为一个端点的所有边。在灯的总数最小的前提下,被两盏灯同时照亮的边数应尽量大。思路:无向无环图的另一个说法是“森林”,即由多棵树组成,我们可以先算一棵树上的答案,然后累加起来就行了。本题的优化目标有两个:放置的灯数应尽量少,被两盏灯照亮的边数b应尽量大。为了统一起见,我们把原创 2016-03-23 19:22:31 · 508 阅读 · 0 评论 -
Codeforces Round #343 (Div. 2) E. Famil Door and Roads (树形dp,lca)
Famil Door’s City map looks like a tree (undirected connected acyclic graph) so other people call it Treeland. There are n intersections in the city connected by n - 1 bidirectional roads.There原创 2016-02-25 20:12:52 · 827 阅读 · 0 评论 -
zjnu1709 UZASTOPNI (bitset,树形dp)
DescriptionPetar is throwing a birthday party and he decided to invite some of the employees of his company where he is the CEO. Each employee, including Petar, has a unique label from 1 to N, a原创 2016-03-09 21:16:37 · 654 阅读 · 0 评论 -
LA3902 Network (树上dfs)
题目链接:点击打开链接题意:n台机器连成一个树状网络,其中叶节点是客户端,其他节点是服务器,目前有一台服务器s正在提供服务。让你在其他服务器上也安排同样的服务,使得每台客户端到最近服务器的距离不超过k,而且要使服务器尽量少,问最少要设置多少台服务器。思路:我们先把s看做根节点,做一遍dfs,把离s距离小于等于k的叶子节点标为访问过,表示这个叶子节点已经得到服务了,然后再把没有访问过的叶子节原创 2016-03-30 12:42:55 · 739 阅读 · 0 评论 -
codeforces 632F. Magic Matrix (最小生成树)
You're given a matrix A of size n × n.Let's call the matrix with nonnegative elements magic if it is symmetric (so aij = aji), aii = 0 and aij ≤ max(aik, ajk) for all triples i, j, k. Note that原创 2016-03-03 21:53:44 · 1612 阅读 · 3 评论 -
hdu4003 Find Metal Mineral
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 2996 Accepted Submission(s): 1377Problem DescriptionHumans have discovered a ki原创 2015-10-30 19:29:35 · 555 阅读 · 0 评论 -
poj1947 Rebuilding Roads
Time Limit: 1000MS Memory Limit: 30000KTotal Submissions: 10297 Accepted: 4701DescriptionThe cows have reconstructed Farmer John's farm, with its N barns (1 <= N <= 150, nu原创 2015-10-24 10:18:28 · 432 阅读 · 0 评论 -
poj1155 TELE
Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4314 Accepted: 2337DescriptionA TV-network plans to broadcast an important football match. Their network of transm原创 2015-10-22 18:39:58 · 911 阅读 · 0 评论 -
hdu1011 Starship Troopers
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14426 Accepted Submission(s): 3887Problem DescriptionYou, the leader of Starsh原创 2015-10-22 21:12:16 · 497 阅读 · 0 评论 -
Codeforces Round #135 (Div. 2) D. Choosing Capital for Treeland
time limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe country Treeland consists of n cities, some pairs of them ar原创 2015-10-22 10:10:21 · 785 阅读 · 0 评论 -
hdu1520 Anniversary party
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7191 Accepted Submission(s): 3174Problem DescriptionThere is going to be a part原创 2015-10-21 14:52:15 · 411 阅读 · 0 评论 -
hdu5886Tower Defence(树形dp)
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 242 Accepted Submission(s): 80Problem DescriptionThere was a civil war between原创 2016-09-20 15:10:20 · 698 阅读 · 0 评论