Submission #428822

#TimeUsernameProblemLanguageResultExecution timeMemory
428822AmineWeslatiWiring (IOI17_wiring)C++14
13 / 100
30 ms3780 KiB
#include "wiring.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int>vi; #define pb push_back #define sz(v) (int)v.size() #define FOR(i,a,b) for(int i=a; i<b; i++) ll min_total_length(vi a, vi b) { int N=sz(a),M=sz(b); ll ans=0; for(int x: a) ans-=x; for(int x: b) ans+=x; if(N>M){ ll r=N-M; ans+=b[0]*r; } else{ ll r=M-N; ans-=a[N-1]*r; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...