Skip to content

Commit e4af828

Browse files
committed
[Week04] BOJ 14925: 목장 건설하기
1 parent 267c14e commit e4af828

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include <iostream>
2+
#include <algorithm>
3+
4+
using namespace std;
5+
6+
int dp[1001][1001];
7+
8+
int main() {
9+
int n, m;
10+
cin >> n >> m;
11+
12+
int ans = 0;
13+
for (int i = 1; i <= n; i++) {
14+
for (int j = 1; j <= m; j++) {
15+
int x;
16+
cin >> x;
17+
18+
if (x == 0) {
19+
dp[i][j] = min({ dp[i - 1][j - 1],dp[i - 1][j],dp[i][j - 1] }) + 1;
20+
ans = max(ans, dp[i][j]);
21+
}
22+
}
23+
}
24+
25+
cout << ans;
26+
}

0 commit comments

Comments
 (0)