# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
722427 | grossly_overconfident | 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;
#define endl '\n'
//#define int long long
//#define INT_MAX LONG_LONG_MAX
vector<long long> minimum_closure_cost(int n, vector<int> u, vector<int> v, vector<int> w){
int op1 = 0, op2 = 0, total = 0;
for (int i = 0; i < n; i += 2){
op1 += w[i];
}
for (int i = 1; i < n; i += 2){
op2 += w[i];
}
for (int i = 0; i < n; ++i){
total += w[i];
}
vector<long long> out(n);
out[0] = total;
out[1] = min(op1, op2);
return out;
}