------树形dp
文章平均质量分 82
猿的进化之路
这个作者很懒,什么都没留下…
展开
-
hdu5326 树形dp
C - WorkTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 5326Appoint description: System Crawler (Aug 24, 2016 8:38:50 AM)D原创 2016-08-25 14:52:25 · 323 阅读 · 0 评论 -
hdu6035树形dp
“真的难”系列。 首先这题肯定是算贡献,也就是计算出每种颜色参与了多少条路径,但这样正面考虑并不容易,不妨从反面考虑,计算每种颜色没有参与多少路径,然后拿 (路径总数 * 颜色总数) - 没参与的贡献,就是答案了。 对于一种颜色x,怎么计算没参与的路径数目呢,很显然,对于每个不包含颜色x的连通块中任意两点路径都是x不参与的贡献,那么问题就转化为,对于任意一种颜色x,需要求出每个不包含x的连通转载 2017-08-02 10:41:22 · 294 阅读 · 0 评论 -
2016年弱校联萌 H
题目链接https://acm.bnu.edu.cn/v3/problem_show.php?pid=52305 problem descriptionIn ICPCCamp, there are n cities and (n−1) (bidirectional) roads between cities. The i-th road is between th原创 2016-10-03 11:00:49 · 578 阅读 · 0 评论 -
hdu4003
Find Metal MineralTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 3474 Accepted Submission(s): 1615Problem DescriptionHumans原创 2016-10-17 20:54:42 · 629 阅读 · 0 评论 -
hdu4714 树形dp
Tree2cycleTime Limit: 15000/8000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 2218 Accepted Submission(s): 526Problem DescriptionA tree with N原创 2016-09-19 21:22:27 · 385 阅读 · 0 评论 -
hdu5416 树形dp 树上路径异或和
D - CRB and TreeTime Limit:4000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 5416Appoint description: System Crawler (Aug 31, 2016 7:27:46 PM原创 2016-09-02 17:00:55 · 2038 阅读 · 0 评论 -
UVALive 4015 树形dp
A - CavesTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice UVALive 4015 uDebugAppoint description: System Crawler (Aug 31, 2016 11:09:27 P原创 2016-09-06 11:24:44 · 368 阅读 · 0 评论 -
hdu4616 树形dp
GameTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2038 Accepted Submission(s): 671Problem Description Nowadays, there are原创 2016-09-14 16:05:58 · 419 阅读 · 0 评论 -
hdu5723 最小生成树 树形dp
Abandoned countryTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 4607 Accepted Submission(s): 1153Problem DescriptionAn aba原创 2016-08-29 10:46:37 · 416 阅读 · 0 评论 -
hdu1561 树形dp
超链接 汉语题,树形dp,dp[u][j],表示u点包括u点以下的点一共有j个点被使用了,那么u点与v点是怎么递推的呢,u是v的父节点,u要选择j个,那么从v里选择k个节点,从u里选j-k个节点,组成j个节点。#include <set>#include <map>#include <stack>#include <queue>#include <math.h>#include <vec原创 2017-09-02 12:10:52 · 282 阅读 · 0 评论