Pagini recente » Cod sursa (job #2755588) | Cod sursa (job #1253594) | Cod sursa (job #2253687) | Cod sursa (job #2744863) | Cod sursa (job #2359859)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("cladire.in");
ofstream fout("cladire.out");
bitset <1004> a[1004];
int b[1004][1004], n, m, lmax;
void Init()
{
for(int i=1; i<=n; i++)
a[i] = ~a[i];
}
int main()
{
int i, j, p, x, y;
fin >> n >> m;
fin >> p;
Init();
for(i=1; i<=p; i++)
{
fin >> x >> y;
a[x][y] = 0;
}
for(i=1; i<=n; i++)
for(j=1; j<=m; j++)
if(a[i][j] == 0) b[i][j] = 0;
else
{
b[i][j] = 1 + min({b[i-1][j], b[i-1][j-1], b[i][j-1]});
lmax = max(lmax, b[i][j]);
}
fout << lmax << "\n";
return 0;
}