摘要:
简单树形DP,父节点要么去要么不去;res[i]=max(∑res[child[i]],∑res[child(child[i])]);#include<iostream>#include<cstdio>#include<cstring>using namespace std;struct node{ int i,next;}vert[201];char name[201][20];int head[201],res[201],go[201],nogo[201],N,count;int find(char * str){ int i; for(i=1;i< 阅读全文