Submission #1265

# Submission time Handle Problem Language Result Execution time Memory
1265 2013-06-30T15:56:36 Z kk1401 고기잡이 (KOI13_fish) C++
0 / 18
0 ms 8704 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;
 freopen("input.txt","r",stdin);
 freopen("output.txt","w",stdout);
 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 Runtime error 0 ms 8704 KB close (syscall #3) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 8704 KB close (syscall #3) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 8704 KB close (syscall #3) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 8704 KB close (syscall #3) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 8704 KB close (syscall #3) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -