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 <bits/stdc++.h>
using namespace std;
#define int long long
vector<int> minimum_closure_costs(signed N, vector<signed> U, vector<signed> V,
vector<signed> W) {
if (U == vector<signed>(N - 1, 0)) {
vector<int> prefSum(N);
sort(W.begin(), W.end());
for (int i = 0; i < N - 1; ++i)
prefSum[i + 1] = prefSum[i] + W[i];
reverse(prefSum.begin(), prefSum.end());
return prefSum;
}
return vector<int>(N, 0);
}
# | 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... |