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;
#define int64 long long
const int mxN = 1e6+5;
int64 min_total_length(vector<int> r, vector<int> b) {
int i = r.size()-1, j = b.size()-1;
int64 ans = 0;
while(i >= 0 && j >= 0)
ans += (b[j]-r[i]), i--, j--;
while(i >= 0)
ans += (b[0]-r[i]), i--;
while(j >= 0)
ans += (b[j]-r[0]), 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... |