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>
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
int n, m;
ll min_total_length(vector<int> r, vector<int> b) {
n = r.size();
m = b.size();
int i = n-1;
int j = 0;
ll ans = 0;
while (i >= 0 && j < m){
ans += (ll)b[j]-(ll)r[i];
i--;
j++;
}
while (i >= 0){
ans += (ll)b[0]-(ll)r[i];
i--;
}
while (j < m){
ans += (ll)b[j]-(ll)r[n-1];
j++;
}
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... |