Submission #4567

#TimeUsernameProblemLanguageResultExecution timeMemory
4567ansol4328고기잡이 (KOI13_fish)C++98
2.16 / 18
12 ms1088 KiB
#include<stdio.h> int n, l, m; int fish[102][4]; int max; int input() { int i; scanf("%d %d %d",&n,&l,&m); for(i=1 ; i<=n ; i++) { scanf("%d %d",&fish[i][1],&fish[i][2]); } return 0; } int process() { int i, j, k, r=0; int a, b; for(i=1 ; i<=m ; i++) { for(j=1 ; j<=l/2 ; j++) { r=0; a=j; b=l/2-j; k=fish[i][1]+a; k-=n; if(k>0) b+=k, a-=k; if(b+fish[i][2]>n) b=n; for(k=1 ; k<=m ; k++) { if(fish[k][1]>=fish[i][1] && fish[k][1]<=fish[i][1]+a && fish[k][2]>=fish[i][2] && fish[k][2]<=fish[i][2]+b) { r++; } } if(max<r) max=r; } } return 0; } int output() { printf("%d",max); return 0; } int main() { input(); process(); output(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...