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>
#define MAX 1000000000000000000
#define MIN -1
#define pb push_back
#define mp make_pair
#define all(a) a.begin (), a.end()
using namespace std;
typedef vector <int> vi;
typedef long long int ll;
long long min_total_length(vector<int> r,vector<int> b) {
int a = r.size();
int t = b.size();
int i = a-1;
int j = 0;
ll s = 0;
while (i >= 0 and j < t){
s += b[j]-r[i];
i--;
j++;
}
while (i >= 0){
s += b[0]-r[i];
i--;
}
while (j < t){
s+= b[j]-r[a-1];
j++;
}
return s;
}
# | 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... |