# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
18701 |
2016-02-14T06:59:50 Z |
pichulia |
점 모으기 (KOI13_collect) |
C++ |
|
41 ms |
1864 KB |
#include<stdio.h>
#include<algorithm>
int n, m;
int x[100004],y[100005];
int p;
int main()
{
int i, j;
scanf("%d %d",&n,&m);
for(i=0; i<m; i++)scanf("%d %d",&x[i],&y[i]);
std::sort(x,x+m);std::sort(y,y+m);
for(i=0;i<m;i++)p+=std::abs(x[i]-x[m/2]) + std::abs(y[i]-y[m/2]);
printf("%d",p);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1864 KB |
Output is correct |
2 |
Correct |
0 ms |
1864 KB |
Output is correct |
3 |
Correct |
0 ms |
1864 KB |
Output is correct |
4 |
Correct |
0 ms |
1864 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1864 KB |
Output is correct |
2 |
Correct |
0 ms |
1864 KB |
Output is correct |
3 |
Correct |
0 ms |
1864 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
1864 KB |
Output is correct |
2 |
Correct |
9 ms |
1864 KB |
Output is correct |
3 |
Correct |
0 ms |
1864 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
1864 KB |
Output is correct |
2 |
Correct |
16 ms |
1864 KB |
Output is correct |
3 |
Correct |
13 ms |
1864 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
1864 KB |
Output is correct |
2 |
Correct |
24 ms |
1864 KB |
Output is correct |
3 |
Correct |
29 ms |
1864 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
1864 KB |
Output is correct |
2 |
Correct |
39 ms |
1864 KB |
Output is correct |
3 |
Correct |
25 ms |
1864 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1864 KB |
Output is correct |
2 |
Correct |
35 ms |
1864 KB |
Output is correct |
3 |
Correct |
33 ms |
1864 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
1864 KB |
Output is correct |
2 |
Correct |
41 ms |
1864 KB |
Output is correct |
3 |
Correct |
39 ms |
1864 KB |
Output is correct |