poj 1463
摘要:
题意:一城堡的所有的道路形成一个n个节点的树,如果在一个节点上放上一个士兵,那么和这个节点相连的边就会被看守住,问把所有边看守住最少需要放多少士兵。点覆盖问题树形dp或二分图都可以过。代码:View Code #include<iostream>#include<fstream>#include<vector>using namespace std;typedef struct e{ int data; vector<int> a;}e;e edge[1501];int dp[1501][2];int v[1501][2];int n;int s 阅读全文
posted @ 2011-02-24 19:48 宇宙吾心 阅读(538) 评论(0) 推荐(0)
浙公网安备 33010602011771号