# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
569473 | Turkhuu | Road Closures (APIO21_roads) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "roads.h"
#include <vector>
vector<long long> minimum_closure_costs(int n, std::vector<int> u, std::vector<int> v, std::vector<int> w){
sort(w.begin(), w.end());
vector<long long> ans(n);
for(int i = 0; i < n - 1; i++){
ans[n - i - 2] = ans[n - i - 1] + w[i];
}
return ans;
}