# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
206281 | achibasadzishvili | Wiring (IOI17_wiring) | C++17 | 0 ms | 0 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>
#define ll long long
#define f first
#define s second
#define pb push_back
using namespace std;
ll min_total_length(vector<int>a , vector<int>b){
ll n = (ll)a.size() , m = (ll)b.size();
ll l = b[0] - a[n - 1],sa = 0 , sb = 0;
for(int i=0; i<a.size(); i++)
sa += a[i];
for(int i=0; i<b.size(); i++)
sb += b[i];
return n * a[n - 1] - sa + sb - m * b[0] + max(n , m) * l;
}
int main(){
ios::sync_with_stdio(false);
return 0;
}