# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
434541 | medmdg | Wiring (IOI17_wiring) | C++14 | 1 ms | 204 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>
#include "wiring.h"
#define ll long long
using namespace std;
long long min_total_length(std::vector<int> r, std::vector<int> b) {
ll c=0;
ll x=0,y=10000000000;
for(int i=0;i<r.size();i++){
x=max(x,(ll)(r[i]));
c-=r[i];
}
c-=max((unsigned ll)(0),(b.size()-r.size())*x);
for(int i=0;i<b.size();i++){
y=min(x,(ll)(b[i]));
c+=b[i];
}
c+=max((unsigned ll)(0),(r.size()-b.size())*y);
return c;
}
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... |