Submission #4952

#TimeUsernameProblemLanguageResultExecution timeMemory
4952hana5505고기잡이 (KOI13_fish)C++98
18 / 18
124 ms1088 KiB
#include<stdio.h> struct pp{int x,y;}fish[101];int m;int fish_count(int x,int y,int p,int q){int i,cnt=0;for(i=1;i<=m;i++)if(x<=fish[i].x && fish[i].x<=p && y<=fish[i].y && fish[i].y<=q)cnt++;return cnt;}int main(){int n,l,i,j,k,t,ans=0;scanf("%d %d %d",&n,&l,&m);for(i=1;i<=m;i++)scanf("%d %d",&fish[i].x,&fish[i].y);for(i=1;i<=m;i++){for(j=1;j<=m;j++){for(k=1;k<l/2;k++){t=fish_count(fish[i].x,fish[j].y,fish[i].x+k,fish[j].y+(l/2-k));if(t>ans) ans=t;}}}printf("%d",ans);}
#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...