Submission #1068287

#TimeUsernameProblemLanguageResultExecution timeMemory
1068287AbitoWiring (IOI17_wiring)C++17
13 / 100
23 ms5468 KiB
#include "wiring.h" #include <bits/stdc++.h> #define int long long #define pb push_back using namespace std; const int N=1e5+5; int n,m,a[N],b[N]; long long min_total_length(std::vector<int32_t> r, std::vector<int32_t> c) { n=r.size(); m=c.size(); for (int i=1;i<=n;i++) a[i]=r[i-1]; for (int i=1;i<=m;i++) b[i]=c[i-1]; int ans=0; for (int i=1;i<=n;i++) ans-=a[i]; for (int i=1;i<=m;i++) ans+=b[i]; if (n<m) for (int i=1;i<=m-n;i++) ans-=a[n]; if (m<n) for (int i=1;i<=n-m;i++) ans+=b[1]; 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...