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>
#include "wiring.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define fi first
#define se second
#define mp make_pair
ll min_total_length(vector<int> r, vector<int> b) {
ll res = 0;
while(b.size() > r.size()){
res += b.back() - r.back();
b.pop_back();
}
reverse(r.begin(), r.end());
while(r.size() > b.size()){
res += b[0] - r.back();
r.pop_back();
}
for(auto x : b) res += x;
for(auto x : r) res -= x;
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... |