# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
170340 | ngmh | Wiring (IOI17_wiring) | C++11 | 37 ms | 3836 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 "wiring.h"
#include <bits/stdc++.h>
long long min_total_length(std::vector<int> r, std::vector<int> b) {
long long rr, bb, t = 0;
rr = r[r.size()-1];
bb = b[0];
for(int i = 0; i < r.size(); i++) t += abs(r[i]-rr);
for(int i = 0; i < b.size(); i++) t += abs(b[i]-bb);
return t+std::max(r.size(), b.size())*(bb-rr);
}
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... |