poj 1655
摘要:
题意:一棵树,定义每个节点的balance值:去掉这点节点后的森林里所有树的最大节点数。求出最小的balance值和其所对应的节点编号。代码:#include<iostream>#include<fstream>using namespace std;struct e{ int data; e *next;};e edge[20001];int v[20001];int a[20001];int b[20001];int n;void solve(int s){ int i,j=0,k=0; e *p=edge[s].next; v[s]=1; while(p){ if 阅读全文
posted @ 2011-05-18 21:20 宇宙吾心 阅读(399) 评论(0) 推荐(0)
浙公网安备 33010602011771号