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 endl "\n"
// #define int long long
typedef long long ll ;
const ll ooo = 1e14 ;
const ll oo = 2e9 ;
const double PI = acos(-1) ;
const ll M = 1e9 + 7 ;
const int N = 10000010 ;
ll dp[222][222];
ll min_total_length(vector<int> r, vector<int> b) {
ll nr = r.size() , nb = b.size();
ll ans = 0 ;
for(int i = 0 ; i < nr ; ++i) ans += r[nr - 1] - r[i];
for(int i = 0 ; i < nb ; ++i) ans += abs(b[0] - b[i]);
return ans + max(nr , nb) * abs(b[0] - r[nr - 1]);
}
# | 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... |