# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
131256 | amiratou | 전선 연결 (IOI17_wiring) | C++14 | 37 ms | 3860 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
ll min_total_length(vector<int> r,vector<int> b) {
ll ans=0;
if(r.size()>b.size()){
for (int i = 0; i < b.size(); ++i)
ans+=(b[i]-r[r.size()-i-1]);
for (int i = r.size()-b.size()-1; i >=0 ; i--)
ans+=b[0]-r[i];
}
else{
for (int i = 0; i < r.size(); ++i)
ans+=b[i]-r[i];
for (int i = r.size(); i < b.size(); ++i)
ans+=b[i]-r[r.size()-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... |