# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
569917 | Edil | Road Closures (APIO21_roads) | C++17 | 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 <bits/stdc++.h>
using namespace std;
vector <int> minimum_closure_costs(int n, int u[], int v[], int w[])
{
vector <int> ans;
int sm = 0;
for(int i = 0; i < n-1; i++)
{
sm += w[i];
ans.push_back(sm);
}
reverse(ans.begin(), ans.end());
ans.push_back(0);
return ans;
}