#include <stdio.h>
int sum[10001][2], Planex[10001], Planey[10001], Fishx[10001][3], Fish[10001][3], Sum[10001][3];
int main()
{
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int n, i, j, l, m, k, a;
int cnt=0, min=999999, cntx=0, sumx=0;
scanf("%d %d %d", &n, &l, &m);
for (i=1; i<=m; i++)
{
scanf("%d %d", &Fish[i][1], &Fish[i][2]);
Fishx[i][1] = Fish[i][1];
Fishx[i][2] = Fish[i][2];
}
for (i=1; i<=l/2; i++)
{
for (j=1; j<=l/2; j++)
{
if ((i+j)*2 == l)
{
cnt++;
Sum[cnt][1] = i;
Sum[cnt][2] = j;
}
}
}
sumx=cnt;
cnt=0;
for (i=1; i<=m; i++)
{
for (j=1; j<=m; j++)
{
if (min > Fish[j][1])
{
min = Fish[j][1];
}
}
if (min != 999009)
{
cnt++;
Planex[cnt] = min;
for (j=1; j<=m; j++)
{
if (Fish[j][1] == min) Fish[j][1] = 999999;
}
}
else break;
min=999999;
}
min=999999;
int checkx=0;
for (i=1; i<=m; i++)
{
for (j=1; j<=m; j++)
{
if (min > Fish[j][2])
{
min = Fish[j][2];
}
}
if (min != 999999)
{
cntx++;
Planey[cntx] = min;
for (j=1; j<=m; j++)
{
if (Fish[j][2] == min) Fish[j][2] = 999999;
}
}
else break;
min=999999;
}
int res=0, cnty=0;
for (i=1; i<=sumx; i++)
{
for (j=1; j<=cntx; j++)
{
for (k=1; k<=cnt; k++)
{
for (a=1; a<=m; a++)
{
if (Fishx[a][1] >= Planex[j] && Fishx[a][2] >= Planey[k])
{
if (Fishx[a][1] <= Planex[j] + Sum[i][1])
{
if (Fishx[a][2] <= Planey[k] + Sum[i][2])
{
cnty++;
}
}
}
}
if (res < cnty)
{
res = cnty;
}
cnty=0;
}
}
}
printf("%d", res);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1392 KB |
Output is correct |
2 |
Correct |
0 ms |
1392 KB |
Output is correct |
3 |
Correct |
0 ms |
1392 KB |
Output is correct |
4 |
Correct |
0 ms |
1392 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1392 KB |
Output is correct |
2 |
Correct |
0 ms |
1392 KB |
Output is correct |
3 |
Correct |
0 ms |
1392 KB |
Output is correct |
4 |
Correct |
0 ms |
1392 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
1392 KB |
Output is correct |
2 |
Correct |
5 ms |
1392 KB |
Output is correct |
3 |
Correct |
12 ms |
1392 KB |
Output is correct |
4 |
Correct |
48 ms |
1392 KB |
Output is correct |
5 |
Correct |
0 ms |
1392 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1392 KB |
Output is correct |
2 |
Correct |
74 ms |
1392 KB |
Output is correct |
3 |
Correct |
76 ms |
1392 KB |
Output is correct |
4 |
Correct |
72 ms |
1392 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
119 ms |
1392 KB |
Output is correct |
2 |
Correct |
66 ms |
1392 KB |
Output is correct |
3 |
Correct |
101 ms |
1392 KB |
Output is correct |
4 |
Correct |
120 ms |
1392 KB |
Output is correct |