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"
long long min_total_length(std::vector<int> R, std::vector<int> B) {
long long x = 0;
std::vector<long long> r, b;
for(auto i: R)
x-=i, r.push_back(i);
for(auto i: B)
x+=i, b.push_back(i);
if(r.size() < b.size()) {
x-=(b.size()-r.size())*r.back();
} else {
x+=(r.size()-b.size())*b[0];
}
return x;
}
# | 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... |