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;
typedef long long ll;
#define f1r(i, a, b) for (int (i) = (a); (i) < (b); ++i)
#define f0r(i, a) f1r(i, 0, a)
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define sz(x) (int) (x).size()
#define all(v) (v).begin(), (v).end()
long long min_total_length(std::vector<int> r, std::vector<int> b) {
ll n = sz(r);
ll m = sz(b);
ll ans = 0;
ll gap = b[0] - r.back();
ans += gap * max(n, m);
for (int x : r) ans -= x;
for (int x : b) ans += x;
ans += n * r.back();
ans -= m * b[0];
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... |