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>
using namespace std;
#define int long long
long long min_total_length(vector<signed> r, vector<signed> b) {
int ans = 0;
reverse(r.begin(), r.end());
for(auto x: r)
ans += abs(x-b[0]);
for(auto x: b)
ans += abs(x-r[0]);
ans -= min(r.size(), b.size())*abs(b[0]-r[0]);
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... |