#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Correct |
0 ms |
1088 KB |
Output is correct |
3 |
Correct |
0 ms |
1088 KB |
Output is correct |
4 |
Correct |
0 ms |
1088 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
1088 KB |
Output is correct |
2 |
Incorrect |
4 ms |
1088 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Incorrect |
60 ms |
1088 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
84 ms |
1088 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |