#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<string> a(n);
for (auto &i : a)
cin >> i;
int mx = 1;
for (int x = 1; x <= n; x++) {
for (int y = 1; y <= m; y++) {
if (x * y <= mx) continue;
vector<vector<bool>> vis(n, vector<bool>(m));
for (int i = 0; i + x <= n; i++) {
for (int j = 0; j + y <= m; j++) {
if (a[i][j] == '0') continue;
bool tr = true;
for (int k = i; k < i + x && tr; k++) {
for (int l = j; l < j + y && tr; l++)
tr = (a[k][l] == '1');
}
if (!tr) continue;
for (int k = i; k < i + x; k++) {
for (int l = j; l < j + y; l++)
vis[k][l] = true;
}
}
}
bool tr = true;
for (int i = 0; i < n && tr; i++) {
for (int j = 0; j < m && tr; j++)
tr = (a[i][j] == '0' || vis[i][j]);
}
if (tr) mx = max(mx, x * y);
}
}
cout << mx;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Execution timed out |
1041 ms |
592 KB |
Time limit exceeded |
4 |
Execution timed out |
1059 ms |
592 KB |
Time limit exceeded |
5 |
Correct |
384 ms |
336 KB |
Output is correct |
6 |
Correct |
179 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
2 ms |
336 KB |
Output is correct |
9 |
Correct |
2 ms |
460 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
1 ms |
504 KB |
Output is correct |
13 |
Correct |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
1 ms |
336 KB |
Output is correct |
15 |
Correct |
1 ms |
336 KB |
Output is correct |
16 |
Correct |
2 ms |
336 KB |
Output is correct |
17 |
Correct |
33 ms |
480 KB |
Output is correct |
18 |
Correct |
67 ms |
508 KB |
Output is correct |
19 |
Correct |
134 ms |
508 KB |
Output is correct |
20 |
Correct |
134 ms |
336 KB |
Output is correct |
21 |
Correct |
33 ms |
504 KB |
Output is correct |
22 |
Correct |
81 ms |
336 KB |
Output is correct |
23 |
Correct |
629 ms |
336 KB |
Output is correct |
24 |
Correct |
103 ms |
336 KB |
Output is correct |
25 |
Execution timed out |
1006 ms |
336 KB |
Time limit exceeded |
26 |
Execution timed out |
1059 ms |
508 KB |
Time limit exceeded |
27 |
Execution timed out |
1076 ms |
336 KB |
Time limit exceeded |
28 |
Execution timed out |
1062 ms |
592 KB |
Time limit exceeded |
29 |
Execution timed out |
1066 ms |
592 KB |
Time limit exceeded |
30 |
Execution timed out |
1065 ms |
592 KB |
Time limit exceeded |
31 |
Execution timed out |
1057 ms |
592 KB |
Time limit exceeded |
32 |
Execution timed out |
1061 ms |
592 KB |
Time limit exceeded |
33 |
Execution timed out |
1073 ms |
592 KB |
Time limit exceeded |
34 |
Execution timed out |
1061 ms |
336 KB |
Time limit exceeded |
35 |
Execution timed out |
1048 ms |
592 KB |
Time limit exceeded |
36 |
Execution timed out |
1049 ms |
592 KB |
Time limit exceeded |
37 |
Correct |
2 ms |
336 KB |
Output is correct |
38 |
Execution timed out |
1091 ms |
8088 KB |
Time limit exceeded |
39 |
Correct |
2 ms |
336 KB |
Output is correct |
40 |
Execution timed out |
1089 ms |
1360 KB |
Time limit exceeded |
41 |
Correct |
2 ms |
336 KB |
Output is correct |
42 |
Execution timed out |
1097 ms |
336 KB |
Time limit exceeded |
43 |
Execution timed out |
1074 ms |
8332 KB |
Time limit exceeded |
44 |
Execution timed out |
1061 ms |
592 KB |
Time limit exceeded |
45 |
Execution timed out |
1051 ms |
8088 KB |
Time limit exceeded |
46 |
Execution timed out |
1071 ms |
8088 KB |
Time limit exceeded |
47 |
Execution timed out |
1054 ms |
8112 KB |
Time limit exceeded |
48 |
Execution timed out |
1070 ms |
8084 KB |
Time limit exceeded |
49 |
Execution timed out |
1039 ms |
8084 KB |
Time limit exceeded |
50 |
Execution timed out |
1052 ms |
8084 KB |
Time limit exceeded |
51 |
Execution timed out |
1069 ms |
8084 KB |
Time limit exceeded |
52 |
Execution timed out |
1062 ms |
8184 KB |
Time limit exceeded |
53 |
Execution timed out |
1050 ms |
8064 KB |
Time limit exceeded |
54 |
Execution timed out |
1069 ms |
8084 KB |
Time limit exceeded |
55 |
Execution timed out |
1059 ms |
8088 KB |
Time limit exceeded |
56 |
Execution timed out |
1059 ms |
8288 KB |
Time limit exceeded |
57 |
Execution timed out |
1042 ms |
8084 KB |
Time limit exceeded |
58 |
Execution timed out |
1057 ms |
8088 KB |
Time limit exceeded |
59 |
Execution timed out |
1063 ms |
8356 KB |
Time limit exceeded |
60 |
Execution timed out |
1042 ms |
8092 KB |
Time limit exceeded |
61 |
Execution timed out |
1051 ms |
8084 KB |
Time limit exceeded |
62 |
Execution timed out |
1058 ms |
8092 KB |
Time limit exceeded |
63 |
Execution timed out |
1063 ms |
8084 KB |
Time limit exceeded |
64 |
Execution timed out |
1050 ms |
8104 KB |
Time limit exceeded |
65 |
Execution timed out |
1056 ms |
8076 KB |
Time limit exceeded |
66 |
Execution timed out |
1058 ms |
8108 KB |
Time limit exceeded |
67 |
Execution timed out |
1065 ms |
8368 KB |
Time limit exceeded |
68 |
Execution timed out |
1044 ms |
8088 KB |
Time limit exceeded |
69 |
Execution timed out |
1038 ms |
8088 KB |
Time limit exceeded |
70 |
Execution timed out |
1045 ms |
5440 KB |
Time limit exceeded |
71 |
Execution timed out |
1043 ms |
8084 KB |
Time limit exceeded |
72 |
Execution timed out |
1050 ms |
8092 KB |
Time limit exceeded |
73 |
Execution timed out |
1061 ms |
8084 KB |
Time limit exceeded |
74 |
Execution timed out |
1062 ms |
8304 KB |
Time limit exceeded |
75 |
Execution timed out |
1058 ms |
8100 KB |
Time limit exceeded |
76 |
Execution timed out |
1071 ms |
8084 KB |
Time limit exceeded |
77 |
Execution timed out |
1063 ms |
8084 KB |
Time limit exceeded |
78 |
Execution timed out |
1068 ms |
8084 KB |
Time limit exceeded |
79 |
Execution timed out |
1042 ms |
8316 KB |
Time limit exceeded |
80 |
Execution timed out |
1056 ms |
8088 KB |
Time limit exceeded |
81 |
Execution timed out |
1061 ms |
8092 KB |
Time limit exceeded |
82 |
Execution timed out |
1075 ms |
8084 KB |
Time limit exceeded |
83 |
Execution timed out |
1058 ms |
8084 KB |
Time limit exceeded |
84 |
Execution timed out |
1058 ms |
8092 KB |
Time limit exceeded |
85 |
Execution timed out |
1064 ms |
8084 KB |
Time limit exceeded |
86 |
Execution timed out |
1047 ms |
8092 KB |
Time limit exceeded |
87 |
Execution timed out |
1068 ms |
8084 KB |
Time limit exceeded |
88 |
Execution timed out |
1066 ms |
8080 KB |
Time limit exceeded |
89 |
Execution timed out |
1061 ms |
8116 KB |
Time limit exceeded |
90 |
Execution timed out |
1065 ms |
5348 KB |
Time limit exceeded |
91 |
Execution timed out |
1057 ms |
8088 KB |
Time limit exceeded |
92 |
Execution timed out |
1047 ms |
8092 KB |
Time limit exceeded |
93 |
Execution timed out |
1073 ms |
8088 KB |
Time limit exceeded |
94 |
Execution timed out |
1048 ms |
8076 KB |
Time limit exceeded |
95 |
Execution timed out |
1052 ms |
8084 KB |
Time limit exceeded |
96 |
Execution timed out |
1061 ms |
8104 KB |
Time limit exceeded |
97 |
Execution timed out |
1070 ms |
8084 KB |
Time limit exceeded |
98 |
Execution timed out |
1059 ms |
8084 KB |
Time limit exceeded |
99 |
Execution timed out |
1061 ms |
8100 KB |
Time limit exceeded |
100 |
Execution timed out |
1054 ms |
8108 KB |
Time limit exceeded |