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 <iostream>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <unordered_set>
#include <vector>
#include <utility>
#include "wiring.h"
using namespace std;
long long min_total_length(vector<int> r, vector<int> b) {
long long n = r.size(), m = b.size(), sum = 0;
for (int i = 0; i < n; i++){
sum += b[0]-r[i];
}
for (int i = 0; i < m; i++){
sum += b[i]-r[n-1];
}
sum -= min(n, m) * (b[0]-r[n-1]);
return 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... |