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"
#include <bits/stdc++.h>
long long min_total_length(std::vector<int> r, std::vector<int> b) {
long long r_sum = accumulate(r.begin(), r.end(), 0LL);
long long b_sum = accumulate(b.begin(), b.end(), 0LL);
long long rn = r.size(), bn = b.size();
if(rn > bn) b_sum += b[0] * (rn - bn);
else if(rn < bn) r_sum += r.back() * (bn - rn);
return b_sum - r_sum;
}
# | 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... |