Submission #250603

#TimeUsernameProblemLanguageResultExecution timeMemory
250603dvdg6566Simfonija (COCI19_simfonija)C++14
11 / 110
2 ms640 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef pair<ll,ll> pi; typedef vector<pi> vpi; typedef double ld; #define pb emplace_back #define mp make_pair #define lb lower_bound #define ub upper_bound #define ALL(x) x.begin(), x.end() #define SZ(x) (ll)x.size() #define f first #define s second const ll MAXN=1001; const ll MAXK=1000001; const ll INF = 1e13; const ll MOD = 1e9+7; vi V; ll T; ll A[MAXN]; ll B[MAXN]; ll N,K; int main(){ ios_base::sync_with_stdio(0);cin.tie(0); cin>>N>>K; for(int i=0;i<N;++i){ cin>>A[i]; } for(int i=0;i<N;++i){ cin>>B[i]; V.pb(B[i]-A[i]); } sort(ALL(V)); assert(!K); ll ans=0; ll r=V[N/2]; for(auto i:V)ans+=abs(i-r); cout<<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...
#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...