답안 #7405

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
7405 2014-08-05T02:43:06 Z gs13068 고기잡이 (KOI13_fish) C++
18 / 18
4 ms 1088 KB
#include<cstdio>
#include<algorithm>

std::pair<int,int> a[100];

int x[51];
int y[51];

int main()
{
  int res=0;
  int i,j,k,t,n,m;
  scanf("%*d%d%d",&n,&m);
  n>>=1;
  for(i=0;i<m;i++)scanf("%d%d",&a[i].first,&a[i].second);
  for(i=0;i<m;i++)for(j=0;j<m;j++)
  {
    for(k=0;k<=n;k++)x[k]=y[k]=0;
    for(k=0;k<m;k++)if(a[k].first>=a[i].first&&a[k].second>=a[j].second&&a[k].first+a[k].second-a[i].first-a[j].second<=n)
    {
      x[a[k].first-a[i].first]++;
      y[a[k].second-a[j].second]++;
    }
    t=0;
    for(k=0;k<=n;k++)
    {
      t+=x[k];
      if(k>0&&k<n&&t>res)res=t;
      t-=y[n-k];
    }
  }
  printf("%d",res);
}
# 결과 실행 시간 메모리 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 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
5 Correct 0 ms 1088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 4 ms 1088 KB Output is correct
3 Correct 4 ms 1088 KB Output is correct
4 Correct 4 ms 1088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 4 ms 1088 KB Output is correct
4 Correct 4 ms 1088 KB Output is correct