Submission #5312

# Submission time Handle Problem Language Result Execution time Memory
5312 2014-03-22T06:18:18 Z baneling100 점 모으기 (KOI13_collect) C++
0 / 24
8 ms 1164 KB
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>

using namespace std;

int n, m, y[10001], x[10001], ans;

void input(void)
{
    int i;

    scanf("%d %d",&n,&m);
    for(i=1 ; i<=n ; i++)
        scanf("%d %d",&y[i],&x[i]);
    sort(y+1,y+n+1);
    sort(x+1,x+n+1);
}

void process(void)
{
    int i;

    for(i=1 ; i<=n ; i++)
        ans+=abs(y[(n+1)/2]-y[i])+abs(x[(n+1)/2]-x[i]);
}

void output(void)
{
    printf("%d",ans);
}

int main(void)
{
    input();
    process();
    output();

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1164 KB Output is correct
2 Incorrect 0 ms 1164 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1164 KB Output is correct
2 Incorrect 0 ms 1164 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1164 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1164 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1164 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1164 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 1164 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1164 KB Output isn't correct
2 Halted 0 ms 0 KB -