hdu 3907
摘要:
经典的树形dp,dp[y][z], 以y为根的子树,祖先z做副本。代码:#include <iostream>#include<fstream>using namespace std;struct e{ int data; int weight; e *next;};e edge[1001];int n;void add(int s,int t,int weight){ e *p=new e; p->data=t; p->next=edge[s].next; p->weight=weight; edge[s].next=p;}int s[1001],q 阅读全文
posted @ 2011-08-26 21:04 宇宙吾心 阅读(219) 评论(0) 推荐(0) 编辑