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;
#define ll long long
#define sz size()
#define ff first
#define ss second
#define pb push_back
#define pii pair <ll, ll>
const int N = 2e5 + 5;
vector <pair <ll, pii>> v, q;
vector <ll> jog, jogap;
int deg[N];
vector<long long> minimum_closure_costs(int n, vector<int> l, vector<int> r, vector<int> w) {
ll sum = 0;
for (int i = 0; i < n - 1; ++i) {
sum += w[i];
}
sort (w.rbegin(), w.rend());
jogap.pb(sum);
for (int i = 0; i < n - 1; ++i) {
sum -= w[i];
jogap.pb(sum);
}
return jogap;
}
//int main() {
// freopen ("input.txt", "r", stdin);
// int N;
// assert(1 == scanf("%d", &N));
//
// std::vector<int> U(N - 1), V(N - 1), W(N - 1);
// for (int i = 0; i < N - 1; ++i) {
// assert(3 == scanf("%d %d %d", &U[i], &V[i], &W[i]));
// }
//
// std::vector<long long> closure_costs = minimum_closure_costs(N, U, V, W);
// for (int i = 0; i < static_cast<int>(closure_costs.size()); ++i) {
// if (i > 0) {
// printf(" ");
// }
// printf("%lld",closure_costs[i]);
// }
// printf("\n");
// return 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... |