# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
104694 | promota | Wiring (IOI17_wiring) | C++14 | 0 ms | 0 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>
long long min_total_length(std::vector<int> r,std::vector<int> b){
long long minLen=0;
if(b.size()<=r.size()){
int k=r.size()-b.size();
for(int i=0;i<b.size();i++){
minLen += arr[i]-arr[r.size()-i-1];
}
for(int i=0;i<k;i++)
minLen += b[0]-r[i];
}
else{
int k=b.size()-r.size();
for(int i=0;i<r.size();i++){
minLen += arr[i]-arr[r.size()-i-1];
}
for(int i=r.size();i<b.size();i++)
minLen += b[i]-r[r.size()-1];
}
return minLen;
}