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<cstdio>
#include<algorithm>
using namespace std;
int m,n,a[100005],b[100005],sum;
int main()
{
int i;
scanf("%d%d",&m,&n);
for(i=0;i<n;i++) {
scanf("%d",&a[i]);
scanf("%d",&b[i]);
}
sort(a,a+n);
sort(b,b+n);
for(i=0;i<n;i++){
sum+=abs(a[i]-a[n/2]);
sum+=abs(b[i]-b[n/2]);
}
printf("%d",sum);
}
# | 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... |
# | 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... |