This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
#include<algorithm>
std::pair<int,int> a[100];
int x[101];
int y[101];
int main()
{
int res=0;
int i,j,k,t,n,m;
scanf("%*d%d%d",&n,&m);
n>>=1;
for(i=0;i<m;i++)scanf("%d%d",&a[i].first,&a[i].second);
std::sort(a,a+n);
for(i=0;i<m;i++)for(j=0;j<m;j++)
{
for(k=0;k<=n;k++)x[k]=y[k]=0;
for(k=0;k<m;k++)if(a[k].first>=a[i].first&&a[k].second>=a[j].second&&a[k].first+a[k].second-a[i].first-a[j].second<=n)
{
x[a[k].first-a[i].first]++;
y[a[k].second-a[j].second]++;
}
t=0;
for(k=0;k<=n;k++)
{
t+=x[k];
if(k>0&&k<n&&t>res)res=t;
t-=y[n-k];
}
}
printf("%d",res);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |