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 <algorithm>
using namespace std;
long long min_total_length(std::vector<int> r, std::vector<int> b) {
long long ans = 0;
int red = r.size();
int blue = b.size();
for (int i = 0; i < red - blue; ++i) {
ans += b[0] - r[i];
}
int ptr = max(0, red - blue);
for (int i = 0; i < blue; ++i) {
ans += b[i] - r[min(red - 1, ptr++)];
}
return ans;
}
# | 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... |