hdu 1598 find the most comfortable road
摘要:思路:快排+并查集#include<stdio.h>#include<algorithm>#define inf 999999using namespace std;struct node{ int s,e,w;}road[1005];int xx[1005];int cmp(node a,node b){ return a.w<b.w;}int find(int x){ while(x!=xx[x]) x=xx[x]; return x;}int main(){ int n,m; while(~scanf("%d%d",&n,&
阅读全文
posted @ 2011-11-27 21:58

浙公网安备 33010602011771号