# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1158894 | PagodePaiva | Wiring (IOI17_wiring) | C++20 | 14 ms | 1864 KiB |
#include "wiring.h"
#include<bits/stdc++.h>
using namespace std;
long long min_total_length(std::vector<int> r, std::vector<int> b) {
long long ans = 0;
reverse(r.begin(), r.end());
while(r.size() > b.size()){
ans += abs(r.back()-b[0]);
r.pop_back();
}
while(b.size() > r.size()){
ans += abs(b.back()-r[0]);
b.pop_back();
}
for(int i = 0;i < min((int)r.size(), (int)b.size());i++){
ans += b[i]-r[i];
}
return ans;
}
# | 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... |