Submission #1047887

#TimeUsernameProblemLanguageResultExecution timeMemory
1047887Marco_EscandonRoad Closures (APIO21_roads)C++11
0 / 100
36 ms9676 KiB
//#include "roads.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define x first #define y second std::vector<long long> minimum_closure_costs(int N, std::vector<int> U,std::vector<int> V,std::vector<int> W) { vector<pair<ll,pair<ll,ll>>> cad; ll n=N; for(int i=0; i<N-1; i++) { cad.push_back({W[i],{U[i],V[i]}}); cad.push_back({W[i],{U[i],V[i]}}); } sort(cad.begin(),cad.end()); vector<ll> s(n,0); ll cost=0; for(int i=0; i<n-1; i++) { cost+=cad[i].x; s[n-i-2]=cost; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...