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;
const int M = 105;
int main()
{
int n,m;
cin>>n>>m;
int a[m]={};
for (int i=0;i<m;i++)
cin>>a[i]>>a[i];
sort(a,a+m);
int ind=m/2,ans=0;
for (int i=0;i<m;i++)
ans+=abs(a[ind]-a[i]);
return ans;
}
# | 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... |