답안 #5318

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
5318 2014-03-22T07:39:23 Z baneling100 고기잡이 (KOI13_fish) C++
18 / 18
120 ms 1088 KB
#include <stdio.h>
#include <algorithm>

using namespace std;

pair <int,int> a[101];
int n, l, m, y[101], x[101], ans;

void input(void)
{
    int i;

    scanf("%d %d %d",&n,&l,&m);
    l/=2;
    for(i=1 ; i<=m ; i++)
    {
        scanf("%d %d",&y[i],&x[i]);
        a[i]=make_pair(y[i],x[i]);
    }
    sort(y+1,y+m+1);
    sort(x+1,x+m+1);
}

void process(void)
{
    int i, j, k, o, p, cnt;

    for(i=1 ; i<=m ; i++)
        for(j=1 ; j<=m ; j++)
            for(k=1 ; k<=l-1 ; k++)
            {
                o=l-k;
                cnt=0;
                for(p=1 ; p<=m ; p++)
                {
                    if((y[i]<=a[p].first && a[p].first<=y[i]+k) && (x[j]<=a[p].second && a[p].second<=x[j]+o))
                        cnt++;
                }
                if(ans<cnt)
                    ans=cnt;
            }
}

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

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

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 1088 KB Output is correct
2 Correct 4 ms 1088 KB Output is correct
3 Correct 16 ms 1088 KB Output is correct
4 Correct 44 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 68 ms 1088 KB Output is correct
3 Correct 72 ms 1088 KB Output is correct
4 Correct 68 ms 1088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 112 ms 1088 KB Output is correct
2 Correct 60 ms 1088 KB Output is correct
3 Correct 92 ms 1088 KB Output is correct
4 Correct 120 ms 1088 KB Output is correct