随笔分类 - 树形动态规划
摘要:题目链接:https://vjudge.net/problem/POJ-1655 Consider a tree T with N (1 <= N <= 20,000) nodes numbered 1...N. Deleting any node from the tree yields a fo
阅读全文
摘要:题目链接:https://vjudge.net/problem/UVA-12093 题意: 有n个城市和n-1条路组成了一个树,现在有花费为c1的机器人A和花费为c2的机器人B,两种机器人都是无限量的,如果在城市u放置机器人A,此时与u连接的边都会被覆盖,如果在城市u放置机器人B,那么与u相连的边都
阅读全文
摘要:题目链接:https://vjudge.net/problem/UVALive-2038 题意:给定一棵树,选择尽量少的点,使得每个没有选中的结点至少和一个已经选中的结点相邻。输出最少需要选择的节点数。思路:经典的二分图最小顶点覆盖, 也是经典的树形 DP AC代码:
阅读全文
摘要:题目链接:https://vjudge.net/problem/HDU-1520 There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University
阅读全文
摘要:题目链接:https://vjudge.net/problem/HDU-4514 随着杭州西湖的知名度的进一步提升,园林规划专家湫湫希望设计出一条新的经典观光线路,根据老板马小腾的指示,新的风景线最好能建成环形,如果没有条件建成环形,那就建的越长越好。 现在已经勘探确定了n个位置可以用来建设,在它们
阅读全文
摘要:题目链接:https://vjudge.net/problem/HDU-2196 A school bought the first computer some time ago(so this computer's id is 1). During the recent years the sch
阅读全文
摘要:题目链接:https://vjudge.net/problem/POJ-2486 Wshxzt is a lovely girl. She likes apple very much. One day HX takes her to an apple tree. There are N nodes
阅读全文

浙公网安备 33010602011771号