# hdu 4846 Big Barn【dp】

http://acm.hdu.edu.cn/showproblem.php?pid=4846

#include <cstdio>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <vector>
#include <string>
#include <map>
#include <set>

using namespace std;

int n, t;
int a[1010][1010];
int b[1010][1010];

int main()
{
while (scanf("%d %d", &n, &t) != EOF)
{
for (int i = 0;i <= n;i++)
for (int j = 0;j <= n;j++)
a[i][j] = 1;

int u, v;
//memset(b, 0, sizeof(b));
while (t--)
{
scanf("%d%d", &u, &v);
a[u][v] = 0;
}
for (int i = 1;i <= n;i++)
{
b[i][1] = a[i][1];
b[1][i] = a[1][i];
}
for(int i=2;i<=n;i++)
for (int j = 2;j <= n;j++)
{
if (a[i][j] == 1)
b[i][j] = min(b[i - 1][j - 1], min(b[i - 1][j], b[i][j - 1])) + 1;
else
b[i][j] = 0;
}
int ans = 0;
for (int i = 1;i <= n;i++)
for (int j = 1;j <= n;j++)
{
ans = max(ans, b[i][j]);
}
printf("%d\n", ans);
}
return 0;
}

06-22 1241

07-23 865

07-20 266

03-18 716

09-05 600

08-07 5417

01-13 771

07-14 1137

05-07 20

08-21 1068

04-14 58万+

03-13 14万+

03-04 13万+

03-05 5492

03-08 4万+

03-08 7万+

03-10 12万+

03-12 10万+

03-13 11万+

03-14 9707

03-18 5316

03-18 8312

03-19 3万+

03-19 8万+

03-20 7107

03-24 3万+

03-25 3万+

05-08 4万+

03-25 8万+

03-29 21万+

03-29 1万+

03-29 9万+

03-30 15万+

05-28 4885

05-28 1万+

04-02 4万+

04-03 2970

04-06 7万+

04-07 5万+

04-09 8万+

04-09 2万+

05-17 7143

04-10 2389

04-11 3万+

04-15 5万+

04-18 4万+

04-20 4万+

04-24 3万+

04-29 5656

04-29 4820

04-30 4475

04-30 8190

04-30 7760

05-16 5万+

05-08 4万+

05-11 3万+

05-12 1万+

05-13 369

05-14 5370

05-14 1349

05-16 1万+

05-20 360

05-18 7373

05-27 271

05-18 2726

05-19 9371

05-21 5220

05-21 5199

05-25 2481

05-22 120

05-23 1万+

05-23 5521

#### 2020年，令人惊叹的Echarts！

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客