# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1036440 | DeathIsAwe | Wiring (IOI17_wiring) | C++14 | 22 ms | 3932 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 "wiring.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
long long min_total_length(vector<int> r, vector<int> b) {
ll ans = 0, temp;
if (b.size() > r.size()) {
for (int i=0;i<b.size();i++) {
temp = min(i, (int)r.size() - 1);
ans += b[i] - r[temp];
}
} else {
for (int i=0;i<r.size();i++) {
temp = max((int)b.size()-i-1, 0);
ans += b[temp] - r[(int)r.size()-i-1];
}
}
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... |