# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
597148 | Ahmadsm2005 | Wiring (IOI17_wiring) | C++14 | 33 ms | 2508 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 "grader.cpp"
using namespace std;
long long min_total_length(std::vector<int> r, std::vector<int> b) {
long long ANS=0;
if(b.size()>r.size()){
for(int i=0;i<b.size();i++){
ANS+=abs(b[i]-r[min((int)r.size()-1,i)]);
}
}
else{
int z=b.size()-1;
for(int i=r.size()-1;i>=0;i--){
ANS+=abs(r[i]-b[max(z,0)]);
z--;
}
}
return ANS;
}
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... |