diff --git a/HDOJ/5723_yuanbo123.cpp b/HDOJ/5723_yuanbo123.cpp new file mode 100644 index 0000000..8a8a81b --- /dev/null +++ b/HDOJ/5723_yuanbo123.cpp @@ -0,0 +1,99 @@ +#include +#include +#include +#include +#include +#include +using namespace std; +#define LL long long +#define N 100010 +#define M 1000010 +vector > v[N];//定义一个pair型的主要是因为要在v[].second中储存路径权值 +struct node +{ + int a,b,w; +} edge[M];//储存每条边 +int father[N],vis[N]; +int n,m; +long long ans;//记录总权值; +bool cmp(node x,node y) +{ + return x.w>t; + while(t--) + { + for(i=0; i<=N; i++) + v[i].clear(); + memset(vis,0,sizeof(vis)); + ans=0; + sum=0; + int flag=0; + scanf("%d%d",&n,&m); + if(n==0||m==0) + { + printf("0 0.00\n"); + continue; + } + for(i=1; i<=n; i++) + { + father[i]=i; + } + for(i=0; i