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"wiring.h"
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T>
using matrix = vector<vector<T>>;
long long min_total_length(std::vector<int> r, std::vector<int> b) {
int n = r.size(), m = b.size();
ll resp = 0;
for(int i = 0; i < n; i++)
resp-=r[i];
for(int i = 0; i < n; i++)
resp+=b[i];
while(n > m){
resp+=b[0];
n--;
}
while(m > n){
resp-=r[0];
m--;
}
return resp;
}
# | 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... |