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 <bits/stdc++.h>
#include "roads.h"
using namespace std;
using ll = long long;
vector<ll> minimum_closure_costs(int n, vector<int> U, vector<int> V, vector<int> W) {
sort(W.rbegin(), W.rend());
ll sm = accumulate(W.begin(), W.end(), 0LL);
vector<ll> ans(n);
for (int i = 0; i < n; i++) {
ans[i] = sm;
sm -= W[i];
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |