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 <bits/stdc++.h>
using namespace std;
#define int long long
int arr[100];
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int m;
cin >> m >> m;
for(int i=0;i<m;i++)cin>>arr[i]>>arr[i];
int ans = 0;
sort(arr,arr+m);
for(int i=0;i<m;i++)ans+=abs(arr[i]-arr[m/2]);
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |