2012年9月13日

摘要: 非常nice的一道树形dp题,设f[root][k]表示以root为根节点的子树,在根节点放k个机器人遍历该树所有节点所需要的最小代价,特别的f[root][0]表示root的父节点放一个机器人到该树遍历后又回到父节点。#include<cstdio>#include<vector>#include<cstring>#include<algorithm>using namespace std;#define N 100005int f[N][15];int n,s,k;struct Node{int v,cost,nt;}e[1000000];i 阅读全文

posted @ 2012-09-13 11:10 huangdongfa 阅读(70) 评论(0) 推荐(0)