Submission #931641

#TimeUsernameProblemLanguageResultExecution timeMemory
931641AiperiiiWiring (IOI17_wiring)C++14
13 / 100
18 ms3928 KiB
#include <bits/stdc++.h> //#include "wiring.h" #define ll long long #define ff first #define ss second #define all(x) x.begin(),x.end() #define pb push_back using namespace std; long long min_total_length(vector<int> r,vector<int> b) { int n=r.size(),m=b.size(); ll ans=0; for(int i=0;i<min(n,m);i++)ans+=(ll)b[i]-r[i]; if(n>m){for(int i=m;i<n;i++)ans+=(ll)b[0]-r[i];} else{ for(int i=n;i<m;i++)ans+=(ll)b[i]-r.back();} return ans; } /*signed main(){ ios_base::sync_with_stdio(); cin.tie(0);cout.tie(0); int n,m; cin>>n>>m; vector <int> a(n),b(m); for(int i=0;i<n;i++)cin>>a[i]; for(int i=0;i<m;i++)cin>>b[i]; cout<<min_total_length(a,b); }*/ /* */
#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...