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;
typedef long long ll;
ll min_total_length(vector<int> r, vector<int> b)
{
const int N = r.size();
const int M = b.size();
ll res = 0;
for (int i = 0; i < min(N, M); i++)
{
res += b[i] - r[N-i-1];
}
for (int i = 0; i < N - M; i++)
res += b[0] - r[i];
for (int i = N; i < M; i++)
res += b[i] - r.back();
return res;
}
# | 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... |