# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
471403 | Cross_Ratio | Wiring (IOI17_wiring) | C++14 | 39 ms | 3780 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;
long long min_total_length(vector<int> r,vector<int> b) {
int N = r.size();
int M = b.size();
long long int cnt = 0;
int i, j;
if(N<M) {
for(i=0;i<M;i++) cnt += b[i];
for(i=0;i<M;i++) {
if(i < N) cnt -= r[i];
else cnt -= r[N-1];
}
return cnt;
}
else {
for(i=0;i<N;i++) {
if(i<M) cnt += b[i];
else cnt += b[0];
}
for(i=0;i<N;i++) cnt -= r[i];
return cnt;
}
}
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... |