#include <bits/stdc++.h>
using namespace std;
bool t[2507][2507];
int main()
{
int n,m,lh=2507,lv=2507;
cin>>n>>m;
for(int i=0;i<n;i++)
{
string s;
cin>>s;
for(int j=0;j<m;j++) t[i][j]=(s[j]=='1'?1:0);
}
for(int i=0;i<n;i++)
{
int cur=0;
for(int j=0;j<m;j++)
{
if(t[i][j]==0)
{
if(cur!=0) lh=min(lh,cur);
cur=0;
}
else cur++;
}
if(cur!=0) lh=min(lh,cur);
}
for(int i=0;i<m;i++)
{
int cur=0;
for(int j=0;j<n;j++)
{
if(t[j][i]==0)
{
if(cur!=0) lv=min(lv,cur);
cur=0;
}
else cur++;
}
if(cur!=0) lv=min(lv,cur);
}
printf("%d",lv*lh);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
248 KB |
Output is correct |
2 |
Correct |
2 ms |
492 KB |
Output is correct |
3 |
Correct |
6 ms |
6720 KB |
Output is correct |
4 |
Correct |
6 ms |
6792 KB |
Output is correct |
5 |
Correct |
2 ms |
6792 KB |
Output is correct |
6 |
Correct |
2 ms |
6792 KB |
Output is correct |
7 |
Correct |
2 ms |
6792 KB |
Output is correct |
8 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
11 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
12 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
13 |
Correct |
2 ms |
6792 KB |
Output is correct |
14 |
Correct |
2 ms |
6792 KB |
Output is correct |
15 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
16 |
Correct |
2 ms |
6792 KB |
Output is correct |
17 |
Correct |
2 ms |
6792 KB |
Output is correct |
18 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
19 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
20 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
21 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
22 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
23 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
24 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
25 |
Incorrect |
3 ms |
6792 KB |
Output isn't correct |
26 |
Correct |
2 ms |
6792 KB |
Output is correct |
27 |
Correct |
5 ms |
6792 KB |
Output is correct |
28 |
Incorrect |
7 ms |
6792 KB |
Output isn't correct |
29 |
Incorrect |
7 ms |
6792 KB |
Output isn't correct |
30 |
Incorrect |
9 ms |
6792 KB |
Output isn't correct |
31 |
Incorrect |
8 ms |
6792 KB |
Output isn't correct |
32 |
Incorrect |
8 ms |
6792 KB |
Output isn't correct |
33 |
Incorrect |
10 ms |
6792 KB |
Output isn't correct |
34 |
Incorrect |
5 ms |
6792 KB |
Output isn't correct |
35 |
Incorrect |
10 ms |
6792 KB |
Output isn't correct |
36 |
Correct |
10 ms |
6792 KB |
Output is correct |
37 |
Incorrect |
2 ms |
6792 KB |
Output isn't correct |
38 |
Correct |
237 ms |
14580 KB |
Output is correct |
39 |
Incorrect |
2 ms |
14580 KB |
Output isn't correct |
40 |
Incorrect |
32 ms |
14580 KB |
Output isn't correct |
41 |
Incorrect |
2 ms |
14580 KB |
Output isn't correct |
42 |
Incorrect |
2 ms |
14580 KB |
Output isn't correct |
43 |
Correct |
250 ms |
21340 KB |
Output is correct |
44 |
Incorrect |
11 ms |
21340 KB |
Output isn't correct |
45 |
Incorrect |
233 ms |
27652 KB |
Output isn't correct |
46 |
Correct |
243 ms |
33836 KB |
Output is correct |
47 |
Incorrect |
238 ms |
40004 KB |
Output isn't correct |
48 |
Incorrect |
239 ms |
46016 KB |
Output isn't correct |
49 |
Correct |
242 ms |
52200 KB |
Output is correct |
50 |
Incorrect |
249 ms |
58340 KB |
Output isn't correct |
51 |
Incorrect |
249 ms |
64404 KB |
Output isn't correct |
52 |
Incorrect |
243 ms |
70588 KB |
Output isn't correct |
53 |
Incorrect |
246 ms |
76676 KB |
Output isn't correct |
54 |
Incorrect |
252 ms |
82788 KB |
Output isn't correct |
55 |
Incorrect |
238 ms |
88728 KB |
Output isn't correct |
56 |
Correct |
298 ms |
95056 KB |
Output is correct |
57 |
Incorrect |
241 ms |
101124 KB |
Output isn't correct |
58 |
Incorrect |
246 ms |
107108 KB |
Output isn't correct |
59 |
Incorrect |
255 ms |
113220 KB |
Output isn't correct |
60 |
Correct |
251 ms |
119372 KB |
Output is correct |
61 |
Correct |
237 ms |
125444 KB |
Output is correct |
62 |
Correct |
247 ms |
131072 KB |
Output is correct |
63 |
Correct |
274 ms |
131072 KB |
Output is correct |
64 |
Correct |
247 ms |
131072 KB |
Output is correct |
65 |
Incorrect |
250 ms |
131072 KB |
Output isn't correct |
66 |
Incorrect |
250 ms |
131072 KB |
Output isn't correct |
67 |
Incorrect |
254 ms |
131072 KB |
Output isn't correct |
68 |
Incorrect |
269 ms |
131072 KB |
Output isn't correct |
69 |
Incorrect |
311 ms |
131072 KB |
Output isn't correct |
70 |
Incorrect |
196 ms |
131072 KB |
Output isn't correct |
71 |
Incorrect |
265 ms |
131072 KB |
Output isn't correct |
72 |
Incorrect |
247 ms |
131072 KB |
Output isn't correct |
73 |
Incorrect |
233 ms |
131072 KB |
Output isn't correct |
74 |
Incorrect |
236 ms |
131072 KB |
Output isn't correct |
75 |
Incorrect |
247 ms |
131072 KB |
Output isn't correct |
76 |
Incorrect |
249 ms |
131072 KB |
Output isn't correct |
77 |
Incorrect |
250 ms |
131072 KB |
Output isn't correct |
78 |
Incorrect |
264 ms |
131072 KB |
Output isn't correct |
79 |
Incorrect |
249 ms |
131072 KB |
Output isn't correct |
80 |
Incorrect |
231 ms |
131072 KB |
Output isn't correct |
81 |
Incorrect |
242 ms |
131072 KB |
Output isn't correct |
82 |
Incorrect |
439 ms |
131072 KB |
Output isn't correct |
83 |
Incorrect |
247 ms |
131072 KB |
Output isn't correct |
84 |
Incorrect |
243 ms |
131072 KB |
Output isn't correct |
85 |
Incorrect |
245 ms |
131072 KB |
Output isn't correct |
86 |
Incorrect |
237 ms |
131072 KB |
Output isn't correct |
87 |
Incorrect |
240 ms |
131072 KB |
Output isn't correct |
88 |
Incorrect |
242 ms |
131072 KB |
Output isn't correct |
89 |
Incorrect |
233 ms |
131072 KB |
Output isn't correct |
90 |
Incorrect |
156 ms |
131072 KB |
Output isn't correct |
91 |
Incorrect |
239 ms |
131072 KB |
Output isn't correct |
92 |
Incorrect |
244 ms |
131072 KB |
Output isn't correct |
93 |
Incorrect |
245 ms |
131072 KB |
Output isn't correct |
94 |
Incorrect |
244 ms |
131072 KB |
Output isn't correct |
95 |
Incorrect |
261 ms |
131072 KB |
Output isn't correct |
96 |
Incorrect |
249 ms |
131072 KB |
Output isn't correct |
97 |
Incorrect |
238 ms |
131072 KB |
Output isn't correct |
98 |
Incorrect |
244 ms |
131072 KB |
Output isn't correct |
99 |
Incorrect |
243 ms |
131072 KB |
Output isn't correct |
100 |
Incorrect |
247 ms |
131072 KB |
Output isn't correct |