# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
45343 | Mamnoon_Siam | Wiring (IOI17_wiring) | C++17 | 54 ms | 12936 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>
using namespace std;
#include "wiring.h"
long long min_total_length(std::vector<int> r, std::vector<int> b) {
sort(r.begin(), r.end());
sort(b.begin(), b.end());
long long ret = 0;
for(int i=0; i<r.size(); i++) ret += r.back() - r[i];
for(int i=0; i<b.size(); i++) ret += b[i] - b[0];
ret += max(r.size(), b.size()) * (b[0] - r.back());
return ret;
}
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... |