# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
570227 | ChrisM2309 | Road Closures (APIO21_roads) | C++14 | 0 ms | 0 KiB |
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;
typedef pair<int,int> ii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> wgraf;
typedef pair<int,ii> edge;
#define UNVISITED 0
#define VISITED 1
#define INF 1000000000
#define pb push_back
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
std::vector<long long> minimum_closure_costs(int N, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
vector<ll> ans;
sort(all(W));
ll sum = 0;
for (auto i : W){
sum += i;
ans.pb(sum)
}
reverse(all(ans));
`return ans;
}