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