poj1947专题

树形DP(4) Poj1947 Rebuilding Roads

题目链接:http://poj.org/problem?id=1947  Rebuilding Roads Time Limit: 1000MS Memory Limit: 30000KTotal Submissions: 8566 Accepted: 3835 Description The cows have reconstructed Farmer John's farm,

poj1947(树形dp)

链接:点击打开链接 题意:给出一个n个节点组成的树,问最少删除几条边可以孤立出一个含有m个节点的树 代码: #include <vector>#include <stdio.h>#include <string.h>#include <stdlib.h>#include <iostream>#include <algorithm>using namespace std;cons

poj1947 Rebuilding Roads

Description The cows have reconstructed Farmer John’s farm, with its N barns (1 <= N <= 150, number 1..N) after the terrible earthquake last May. The cows didn’t have time to rebuild any extra road