8000 Merge pull request #45 from Hot6Maina/patch-11 · twinkite/basic-algo-lecture@4eb110f · GitHub
[go: up one dir, main page]

Skip to content

Commit 4eb110f

Browse files
Merge pull request encrypted-def#45 from Hot6Maina/patch-11
Update 1915.cpp
2 parents fac76ef + e7c6d2e commit 4eb110f

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

0x10/solutions/1915.cpp

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
1-
// Authored by : BaaaaaaaaaaarkingDog
1+
// Authored by : Hot6Mania
22
// Co-authored by : -
3-
// http://boj.kr/****************
3+
// http://boj.kr/e5fe7cb3d25e4e4d8e1d94eeb95f04c1
44
#include <bits/stdc++.h>
55
using namespace std;
66

7+
int n, m;
8+
int board[1010][1010], d[1010][1010];
9+
710
int main(void){
811
ios::sync_with_stdio(0);
912
cin.tie(0);
1013

11-
}
14+
cin >> n >> m;
15+
for(int i = 1; i <= n; ++i){
16+
string s;
17+
cin >> s;
18+
for(int j = 1; j <= m; ++j)
19+
board[i][j] = s[j-1] - '0';
20+
}
21+
int ans = 0;
22+
for(int i = 1; i <= n; ++i){
23+
for(int j = 1; j <= m; ++j){
24+
if(board[i][j]){
25+
d[i][j] = min({d[i-1][j], d[i][j-1], d[i-1][j-1]}) + 1;
26+
ans = max(ans, d[i][j]);
27+
}
28+
}
29+
}
30+
cout << ans * ans;
31+
}

0 commit comments

Comments
 (0)
0