Submission #1266

# Submission time Handle Problem Language Result Execution time Memory
1266 2013-06-30T15:59:23 Z kk1401 고기잡이 (KOI13_fish) C++
0 / 18
0 ms 8712 KB
#include<stdio.h>
int x[101], y[101], f[1001][1001], a[1001][1001];
int main()
{
 int n, l, m, i, j, k, ans=0, z;
 scanf("%d %d %d", &n, &l, &m);
 l/=2;
 for(i=1;i<=m;i++){
  scanf("%d %d", &x[i], &y[i]);
  f[x[i]][y[i]] = 1;
 }
 for(i=1;i<=n;i++){
  for(j=1;j<=n;j++){
   a[i][j] = f[i][j]+a[i-1][j]+a[i][j-1]-a[i-1][j-1];
  }
 }
 for(k=1;k<=l;k++){
  if(k>n) break;
  if(l-k>n) continue;
  for(i=l-k;i<=n;i++){
   for(j=k;j<=n;j++){
    z = a[i][j]-a[i-k][j]-a[i][j-(l-k)]+a[i-k][j-(l-k)];
    if(ans<z) ans = z;
   }
  }
 }
 printf("%d", ans);
 return 0;
}


# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 8712 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 8712 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 8712 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 8708 KB SIGSEGV Segmentation fault
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 8708 KB SIGSEGV Segmentation fault
2 Halted 0 ms 0 KB -