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 "wiring.h"
#define ll long long
using namespace std;
ll min_total_length(vector<int> r, vector<int> b) {
ll ret = 0;
ll n = (ll)r.size(), m = (ll)b.size();
for (ll i = 0; i < m; ++i) ret += b[i] - r[n - 1];
for (ll i = 0; i < (n - 1); ++i) ret += r[n - 1] - r[i];
ll dif = n - m;
for (ll i = 0; i < dif; ++i) ret += b[0] - r[n - 1];
return ret;
}
# | 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... |