# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
737306 | keisuke6 | 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 <vector>
#include <algorithm>
using namespace std;
#define ll long long;
std::vector<ll> minimum_closure_costs(int N, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
vector<ll> A = {};
ll a = 0;
for(int i=0;i<W.size();i++) a += W[i];
A.push_back(a);
a = 0;
ll b = 0;
for(int i=0;i<W.size();i++){
if(i%2) a += W[i];
else b += W[i];
}
A.push_back(min(a,b));
while(A.size() != N) A.push_back(0);
return A;
}