Submission #5317

#TimeUsernameProblemLanguageResultExecution timeMemory
5317baneling100고기잡이 (KOI13_fish)C++98
2.16 / 18
84 ms1088 KiB
#include <stdio.h> #include <algorithm> using namespace std; pair <int,int> a[101]; int n, l, m, y[101], x[101], ans; void input(void) { int i; scanf("%d %d %d",&n,&l,&m); l/=2; for(i=1 ; i<=m ; i++) { scanf("%d %d",&y[i],&x[i]); a[i]=make_pair(y[i],x[i]); } sort(a+1,a+m+1); sort(y+1,y+m+1); sort(x+1,x+m+1); } void process(void) { int i, j, k, o, p, cnt; for(i=1 ; i<=m ; i++) for(j=1 ; j<=m ; j++) for(k=1 ; k<=l-1 ; k++) { o=l-k; cnt=0; for(p=1 ; p<=m ; p++) { if((y[i]<=a[p].first && a[p].first<=y[i]+k) && (x[i]<=a[p].second && a[p].second<=x[i]+o)) cnt++; } if(ans<cnt) ans=cnt; } } void output(void) { printf("%d",ans); } int main(void) { 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...