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