# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
313043 | kylych03 | Wiring (IOI17_wiring) | C++14 | 46 ms | 3832 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>
//#include "grader.cpp"
using namespace std;
long long min_total_length(std::vector<int> r, std::vector<int> b) {
sort(r.begin(), r.end());
sort(b.begin(), b.end());
if(r.back() < b[0]){
long long sum = 0;
for(int i = 0 ;i < r.size(); i++)
sum += (r.back() - r[i]);
for(int i = 0 ;i < b.size(); i++)
sum += (b[i] - b[0]);
return sum + max(r.size(), b.size()) * 1ll * (b[0] - r.back());
}
return 0;
}
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... |