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>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
std::vector<long long> minimum_closure_costs(int N, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
int n = N, m = U.size();
ll res = 0;
priority_queue<int> pq;
for (int i = 0; i < m; i++) res += W[i], pq.emplace(W[i]);
vector<ll> ans;
for (int i = 0; i < n; i++) {
ans.emplace_back(res);
if (!pq.empty()) res -= pq.top(), pq.pop();
}
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... |