This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//Subtask 2
#include <vector>
#include <algorithm>
using namespace std;
const int infty = 1e9 + 10;
long long min_total_length(vector<int> r, vector<int> b)
{
int n = r.size();
int m = b.size();
long long ans = 0;
for (int i = 0; i < n; i++)
{
ans += b[0] - r[i];
}
for (int j = 0; j < m; j++)
{
ans += b[j] - r[n - 1];
}
ans -= ((long long)min(n, m)) * (b[0] - 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... |