LeeBlog

导航

2011年3月8日 #

hdu 1142 A Walk Through the Forest

摘要: #include<stdio.h>#include<stdlib.h>int m,n,map[1024][1024],des[1024],dis[1024],dep[1024];int inf = 0x7fffffff;int Dijkstra( int p ){ dis[p] = 0; for( int i = 1; i <= n; ++i ) { int min = inf, pos = 0,t; for( int j = 1; j <= n; ++j ) { if( !des[j] ) if( dis[j] < min ) { min = dis 阅读全文

posted @ 2011-03-08 20:51 LeeBlog 阅读(231) 评论(0) 推荐(0) 编辑

hdu 1874 畅通工程续

摘要: #include<stdio.h>#include<math.h>#include<stdlib.h>struct E{ int x,y,set;}e[124];struct val{ int a,b; double dis;}va[10000];int t,c,count;int cmp( const void *a,const void *b ){ return ((val *)a)->dis > ((val *)b)->dis ? 1 : -1;}int find( int i ){ return e[i].set == i ? i 阅读全文

posted @ 2011-03-08 17:19 LeeBlog 阅读(178) 评论(0) 推荐(0) 编辑