Submission #16290

#TimeUsernameProblemLanguageResultExecution timeMemory
16290khsoo01점 모으기 (KOI13_collect)C++98
24 / 24
42 ms1864 KiB
#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 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...