LeeBlog

导航

2011年5月2日 #

HDU 1233 还是畅通工程

摘要: 这题是一个最小生成树,用kustra做,在给结构体排序时要用快排,不能冒泡,否则超时,这里有我冒泡的代码,你可以提交试试#include<stdio.h>#include<stdlib.h>int set[105],n,m,sum;struct e{ int x,y,v;}val[10000];int cmp( const void *a,const void *b ){ return ( ( e * )a )-> v - ( ( e * )b ) ->v;}int find( int x ){ return x == set[x] ? x : set[x] 阅读全文

posted @ 2011-05-02 13:35 LeeBlog 阅读(180) 评论(0) 推荐(0) 编辑