摘要: Problem DescriptionThere are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your university believe in. You know that there are n students in your university (0 int father[50001 阅读全文
posted @ 2014-01-08 17:15 段少 阅读(173) 评论(0) 推荐(0) 编辑
摘要: #includetypedef struct{ int adj;//某定点与已构造好的部分生成树的顶点之间权值最小的顶点 int lowcost;//某定点与已构造好的部分生成树的顶点之间的最小权值}point;point close[101];//辅助数组int d[101][101];int main(){ int n,i,a,b,sum,j,min,k,m; while(scanf("%d",&n)!=EOF) { if(n==0) break; sum=0;//记录最小生成树的总路径 m=n*(n-1)/2; ... 阅读全文
posted @ 2014-01-08 10:23 段少 阅读(174) 评论(0) 推荐(0) 编辑