# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
409725 | dreezy | Wiring (IOI17_wiring) | C++17 | 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>
using namespace std;
int min_total_length(vector<int> r, vector<int> b){
int ans = 0;
int ind = 0;
if(r.size() < b.size()){
for(int i =0; i<r.size(); i++){
ans+= b[i] - a[i];
}
for(int i = r.size(); i < b.size(); i++)
ans+= b[i] - a[r.size()-1];
}
else{
for(int i =0; i<b.size(); i++){
ans+= b[i] - a[i];
}
for(int i = b.size(); i < r.size(); i++)
ans+= b[0] - a[i];
}
return ans;
}