
树形dp
rgtjf
这个作者很懒,什么都没留下…
展开
-
fzu 月赛 2011年12月
http://acm.fzu.edu.cn/problem.php?pid=2066题意:给一个线路板,分为左边和右边,各N个点,然后给出M条连线(左边和右边),问两两相交的线最多有几个。解法:比如:1 2 3 4 1’ 2‘ 3’ 4‘然后4‘ 连着2,3’连着3,2‘连着4,怎么做呢?先看4连着2’,再看3连着3‘,2连着4’;这样是不是就是在一个序列(2‘,3原创 2013-08-23 22:02:55 · 641 阅读 · 0 评论 -
Codeforces 337d
树形dp,还是要想好再写啊,T^T;#include #include #include #include #include #include #include #include #include #include #include using namespace std;typedef long long LL;const int maxn = 100005;co原创 2013-08-17 13:29:31 · 584 阅读 · 0 评论 -
树形dp ,求最大路径权值,最长路径
#include #include #include #include #include #include #include #include #include #include #include using namespace std;typedef long long LL;const int maxn = 500005;const int maxm = 50000原创 2013-08-31 19:37:27 · 1708 阅读 · 0 评论 -
树形dp总结
From:http://www.cnblogs.com/whxnwjq/archive/2012/05/22/2512497.html列出一些经典问题吧:1:给出一棵树 每个节点有权值 要求父节点和子节点不能同时取 求能够取得的最大值 (hdu1520)2:给出一棵树,求离每个节点最远的点的距离 (hdu2196)3:1>在一个地图上,有N座城堡,每座城堡都有一定的宝物,在转载 2013-09-13 16:16:32 · 498 阅读 · 0 评论 -
EOJ 2103 小强寻宝I
http://acm.cs.ecnu.edu.cn/problem.php?problemid=2103WAT^T 不知道为什么#include #include #include using namespace std;const int maxn = 1005;int n,p;struct node{ int to; int next;}e[maxn];i原创 2013-07-11 22:36:12 · 656 阅读 · 0 评论