From adeccbcc64bfed844d15b6d83e5f976b339edaea Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Mon, 19 Sep 2016 11:35:01 +0800 Subject: [PATCH] Create 5723.cpp --- HDOJ/5723.cpp | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 HDOJ/5723.cpp diff --git a/HDOJ/5723.cpp b/HDOJ/5723.cpp new file mode 100644 index 0000000..54322ed --- /dev/null +++ b/HDOJ/5723.cpp @@ -0,0 +1,113 @@ +#include +#include +#include +#include +#include +using namespace std; +#define MAXN 100100 +#define MAXM 1000100 +#define MAXW 1000100 +using LL = long long; +struct edge +{ + int u,v,w; +}; +bool cmp(const edge& a,const edge& b) +{ + return a.w> vec[MAXN]; + +int findfather(int x) +{ + return father[x]==x?x:father[x]=findfather(father[x]); +} + +LL totalans; + +LL dfs(int index) +{ + vis[index]=1; + int sz=vec[index].size(); + LL ksum=0; + LL nextans=0; + for(int i=0;i