# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
416210 | schse | Wiring (IOI17_wiring) | C++17 | 1091 ms | 204 KiB |
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>
#ifndef EVAL
#include "grader.cpp"
#endif
#define ll long long
#include "wiring.h"
using namespace std;
ll min(ll a, ll b, ll c)
{
return std::min(a, std::min(b, c));
}
long long min_total_length(std::vector<int> r, std::vector<int> b)
{
ll sum = 0;
for (ll lines = 1, i = 1; i < r.size(); i++)
sum += lines * (r[i] - r[i - 1]);
for (ll lines = 1, i = b.size() - 2; i >= 0; i++)
sum += lines * (b[i + 1] - b[i]);
sum += max(r.size(), b.size()) * (b[0] - r.back());
return sum;
}
Compilation message (stderr)
# | 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... |