# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
589975 | AlesL0 | Wiring (IOI17_wiring) | C++17 | 34 ms | 3768 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;
typedef long long ll;
const int INF = 1e9+1;
long long min_total_length(std::vector<int> r, std::vector<int> b){
ll s = 0;
int mr = 0, mb = INF;
for (int i = 0; i < b.size(); i++){
s += b[i]; mb = min(mb, b[i]);
}
for (int i = 0; i < r.size(); i++){
s -= r[i]; mr = max(mr, r[i]);
}
ll n = r.size(), m = b.size();
if (n > m)s += (n-m)*mb;
else s -= (m-n)*mr;
return s;
}
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... |