# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
122532 | baqargam | Wiring (IOI17_wiring) | C++14 | 40 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<bits/stdc++.h>
#include "wiring.h"
using namespace std;
long long min_total_length(vector<int> r, vector<int> b) {
sort(r.begin(),r.end());
sort(b.begin(),b.end());
int n=r.size();
int m=b.size();
long long res=(long long)(b[0]-r[n-1])*max(n,m);
for(int i=0;i<n;i++)
res+=r[n-1]-r[i];
for(int i=0;i<m;i++)
res+=b[i]-b[0];
return res;
}
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... |