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>
using namespace std;
#define int long long
std::vector<int> minimum_closure_costs(int32_t N, std::vector<int32_t > U,
std::vector<int32_t > V,
std::vector<int32_t > W) {
int base = 0;
for(int i=0;i<N-1;i++)base+=W[i];
vector<int> ans = {base};
int curr = 0;
sort(W.rbegin(), W.rend());
for(int i=0;i<N-1;i++){
curr+=W[i];
ans.emplace_back(base-curr);
}
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... |