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 <bits/stdc++.h>
#include "wiring.h"
using namespace std;
using ll = long long;
using vi = vector<ll>;
using pi = pair<long long, long long>;
#define pb emplace_back
ll min_total_length(vector<int> r, vector<int> b) {
ll ans = 0;
int n = r.size();
int m = b.size();
for(int i = 0; i < n; ++i) {
assert(r[i] < b[0]);
}
for(int i = 0; i < m; ++i) {
assert(b[i] > r[n - 1]);
}
for(int i = 0; i < n; ++i) {
ans += b[0] - r[i];
}
for(int i = 1; i < m; ++i) {
ans += b[i] - r[n - 1];
}
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... |