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 ll long long
using namespace std;
ll min_total_length(vector<int> r, vector<int> b) {
int n = r.size(), m = b.size();
if(r[n-1] < b[0]) {
ll ans = 0;
int i = 0, j = 0;
while(i < n or j < m) {
if(i < n and j < m)
ans += b[j++] - r[i++];
else if(i == n)
ans += b[j++] - r[n - 1];
else
ans += b[0] - r[i++];
}
return ans;
}
return 0;
}
# | 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... |