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>
#define ll long long int
#define pb push_back
using namespace std;
vector<ll> minimum_closure_costs(int n, vector<int> u, vector<int> v, vector<int> w){
vector <ll> s, ans;
ll sum = 0, san = 0;
for(auto i: w){
s.pb(i);
sum += i;
}
sort(s.rbegin(), s.rend());
ans.pb(sum);
for(auto i: s){
san += i;
ans.pb(sum-san);
}
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... |