摘要: 题目链接:http://poj.org/problem?id=1861求出最小生成树边的个数,最大边权,和所有边。代码:#include<algorithm>#include<iostream>#include<cstring>#include<cstdio>usingnamespacestd;constintN=1001;intmap[N],ans[N];intnum,maxn,k,i;structedge{inta;intb;intvalue;}p[N*N];intfind(intx){intr=x;while(r!=map[r]){r=ma 阅读全文
posted @ 2012-08-17 19:28 pony1993 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4379多么简单的一道题,比赛的时候竟然想着用数组存上,结果MLE了,然后就一直在纠结他的那句every pair of (Yi, Yj) satisfies Yi+ Yj<= L (1 ≤ i < j ≤ m),and every Yi<= L (1 ≤ i ≤ m )。。。。思路:从1-n算出Xi ,如果<=L/2,sum++,算的过程中记下<=L/2的最大值和>L/2的最小值,如果这两个值的和<=L,sum++。。代码:1#include<iost 阅读全文
posted @ 2012-08-17 08:38 pony1993 阅读(298) 评论(0) 推荐(0) 编辑

View My Stats