diff --git a/src/P2330/P2330.cpp b/src/P2330/P2330.cpp new file mode 100644 index 0000000..09ab8be --- /dev/null +++ b/src/P2330/P2330.cpp @@ -0,0 +1,68 @@ +#include +#include + +using ll = long long; + +auto &is = std::cin; +auto &os = std::cout; + +const ll max_n{300+5},max_m{8000+5}; +struct Edge{ + ll u,v,c; +}edges[max_m]; +ll n, m, u, v, c, edges_size; + +template +struct UnionSet{ + ll father[size]; + constexpr UnionSet()noexcept{ + for(ll i{0};i u_set; +ll ans_num, ans_max; + +int main(){ + is>>n>>m; + + for(ll i{0};i>u>>v>>c; + edges[edges_size++] = {u,v,c}; + } + + std::sort(edges,edges+edges_size,[](Edge &a,Edge &b)constexpr noexcept ->bool{ + return a.c