# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
523090 |
2022-02-07T03:47:49 Z |
dostigator |
Bomb (IZhO17_bomb) |
C++17 |
|
1000 ms |
13092 KB |
#pragma GCC optimize("O3")
#pragma GCC target("popcnt")
#include <bits/stdc++.h>
using namespace std;
#define IShowSpeed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define popcnt __builtin_popcount
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define mii map<int,int>
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define pb push_back
#define vt vector
#define endl '\n'
#define X first
#define Y second
typedef long double ld;
typedef long long ll;
const ll dx[4]={1,-1,0,0},dy[4]={0,0,1,-1},N=1e6+10;
const ll mod=1e9+7,inf=1e18;
void solve(){
int n,m;
cin>>n>>m;
char a[n+2][m+2],c[n+2][m+2];
for(int i=1; i<=n; ++i) for(int j=1; j<=m; ++j) cin>>a[i][j];
int ans=0;
for(int x=1; x<=n; ++x){
for(int y=1; y<=m; ++y){
for(int i=1; i<=n; ++i) for(int j=1; j<=m; ++j) c[i][j]=a[i][j];
for(int i=1; i<=n; ++i) for(int j=1; j<=m; ++j){
int bad=1;
if(i+x-1>n || j+y-1>m) continue;
for(int ol=i; ol<=i+x-1; ++ol) for(int zhas=j; zhas<=j+y-1; ++zhas) if(c[ol][zhas]=='0') bad=0;
if(bad) for(int ol=i; ol<=i+x-1; ++ol) for(int zhas=j; zhas<=j+y-1; ++zhas) c[ol][zhas]='2';
}
int ok=1;
for(int ol=1; ol<=n; ++ol) for(int zhas=1; zhas<=m; ++zhas) if(c[ol][zhas]=='1')ok=0;
if(ok)ans=max(ans,x*y);
}
}
cout<<ans<<endl;
}
int main() {
IShowSpeed;
int tt=1;
//cin>>tt;
while(tt--) solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
308 KB |
Output is correct |
3 |
Execution timed out |
1086 ms |
332 KB |
Time limit exceeded |
4 |
Execution timed out |
1079 ms |
332 KB |
Time limit exceeded |
5 |
Execution timed out |
1081 ms |
204 KB |
Time limit exceeded |
6 |
Correct |
93 ms |
292 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
3 ms |
204 KB |
Output is correct |
9 |
Correct |
3 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
308 KB |
Output is correct |
11 |
Correct |
2 ms |
204 KB |
Output is correct |
12 |
Correct |
2 ms |
204 KB |
Output is correct |
13 |
Correct |
1 ms |
204 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
2 ms |
204 KB |
Output is correct |
16 |
Correct |
3 ms |
204 KB |
Output is correct |
17 |
Execution timed out |
1079 ms |
204 KB |
Time limit exceeded |
18 |
Execution timed out |
1076 ms |
204 KB |
Time limit exceeded |
19 |
Execution timed out |
1050 ms |
204 KB |
Time limit exceeded |
20 |
Execution timed out |
1085 ms |
332 KB |
Time limit exceeded |
21 |
Execution timed out |
1049 ms |
204 KB |
Time limit exceeded |
22 |
Execution timed out |
1072 ms |
332 KB |
Time limit exceeded |
23 |
Execution timed out |
1093 ms |
332 KB |
Time limit exceeded |
24 |
Execution timed out |
1091 ms |
204 KB |
Time limit exceeded |
25 |
Execution timed out |
1097 ms |
332 KB |
Time limit exceeded |
26 |
Execution timed out |
1080 ms |
328 KB |
Time limit exceeded |
27 |
Execution timed out |
1089 ms |
456 KB |
Time limit exceeded |
28 |
Execution timed out |
1096 ms |
588 KB |
Time limit exceeded |
29 |
Execution timed out |
1084 ms |
588 KB |
Time limit exceeded |
30 |
Execution timed out |
1070 ms |
844 KB |
Time limit exceeded |
31 |
Execution timed out |
1073 ms |
716 KB |
Time limit exceeded |
32 |
Execution timed out |
1091 ms |
716 KB |
Time limit exceeded |
33 |
Execution timed out |
1096 ms |
844 KB |
Time limit exceeded |
34 |
Execution timed out |
1095 ms |
460 KB |
Time limit exceeded |
35 |
Execution timed out |
1091 ms |
844 KB |
Time limit exceeded |
36 |
Execution timed out |
1061 ms |
828 KB |
Time limit exceeded |
37 |
Correct |
3 ms |
204 KB |
Output is correct |
38 |
Execution timed out |
1068 ms |
12996 KB |
Time limit exceeded |
39 |
Correct |
3 ms |
204 KB |
Output is correct |
40 |
Execution timed out |
1082 ms |
2208 KB |
Time limit exceeded |
41 |
Correct |
4 ms |
204 KB |
Output is correct |
42 |
Execution timed out |
1093 ms |
332 KB |
Time limit exceeded |
43 |
Execution timed out |
1092 ms |
13056 KB |
Time limit exceeded |
44 |
Execution timed out |
1066 ms |
824 KB |
Time limit exceeded |
45 |
Execution timed out |
1046 ms |
12992 KB |
Time limit exceeded |
46 |
Execution timed out |
1049 ms |
12972 KB |
Time limit exceeded |
47 |
Execution timed out |
1071 ms |
12956 KB |
Time limit exceeded |
48 |
Execution timed out |
1067 ms |
13004 KB |
Time limit exceeded |
49 |
Execution timed out |
1087 ms |
13004 KB |
Time limit exceeded |
50 |
Execution timed out |
1059 ms |
12996 KB |
Time limit exceeded |
51 |
Execution timed out |
1056 ms |
12996 KB |
Time limit exceeded |
52 |
Execution timed out |
1087 ms |
13004 KB |
Time limit exceeded |
53 |
Execution timed out |
1102 ms |
12988 KB |
Time limit exceeded |
54 |
Execution timed out |
1077 ms |
12996 KB |
Time limit exceeded |
55 |
Execution timed out |
1042 ms |
12980 KB |
Time limit exceeded |
56 |
Execution timed out |
1087 ms |
12996 KB |
Time limit exceeded |
57 |
Execution timed out |
1087 ms |
13004 KB |
Time limit exceeded |
58 |
Execution timed out |
1082 ms |
13004 KB |
Time limit exceeded |
59 |
Execution timed out |
1094 ms |
13020 KB |
Time limit exceeded |
60 |
Execution timed out |
1070 ms |
12996 KB |
Time limit exceeded |
61 |
Execution timed out |
1075 ms |
12996 KB |
Time limit exceeded |
62 |
Execution timed out |
1070 ms |
12980 KB |
Time limit exceeded |
63 |
Execution timed out |
1085 ms |
12984 KB |
Time limit exceeded |
64 |
Execution timed out |
1068 ms |
13004 KB |
Time limit exceeded |
65 |
Execution timed out |
1077 ms |
12996 KB |
Time limit exceeded |
66 |
Execution timed out |
1032 ms |
12972 KB |
Time limit exceeded |
67 |
Execution timed out |
1086 ms |
13044 KB |
Time limit exceeded |
68 |
Execution timed out |
1070 ms |
12960 KB |
Time limit exceeded |
69 |
Execution timed out |
1080 ms |
12996 KB |
Time limit exceeded |
70 |
Execution timed out |
1080 ms |
8528 KB |
Time limit exceeded |
71 |
Execution timed out |
1071 ms |
13004 KB |
Time limit exceeded |
72 |
Execution timed out |
1079 ms |
13092 KB |
Time limit exceeded |
73 |
Execution timed out |
1059 ms |
12996 KB |
Time limit exceeded |
74 |
Execution timed out |
1070 ms |
13008 KB |
Time limit exceeded |
75 |
Execution timed out |
1056 ms |
12996 KB |
Time limit exceeded |
76 |
Execution timed out |
1072 ms |
13004 KB |
Time limit exceeded |
77 |
Execution timed out |
1031 ms |
12996 KB |
Time limit exceeded |
78 |
Execution timed out |
1090 ms |
12924 KB |
Time limit exceeded |
79 |
Execution timed out |
1085 ms |
12996 KB |
Time limit exceeded |
80 |
Execution timed out |
1088 ms |
12996 KB |
Time limit exceeded |
81 |
Execution timed out |
1043 ms |
12996 KB |
Time limit exceeded |
82 |
Execution timed out |
1085 ms |
13004 KB |
Time limit exceeded |
83 |
Execution timed out |
1048 ms |
12984 KB |
Time limit exceeded |
84 |
Execution timed out |
1091 ms |
12996 KB |
Time limit exceeded |
85 |
Execution timed out |
1080 ms |
12996 KB |
Time limit exceeded |
86 |
Execution timed out |
1076 ms |
13004 KB |
Time limit exceeded |
87 |
Execution timed out |
1042 ms |
12932 KB |
Time limit exceeded |
88 |
Execution timed out |
1044 ms |
12996 KB |
Time limit exceeded |
89 |
Execution timed out |
1024 ms |
12976 KB |
Time limit exceeded |
90 |
Execution timed out |
1093 ms |
8544 KB |
Time limit exceeded |
91 |
Execution timed out |
1071 ms |
12988 KB |
Time limit exceeded |
92 |
Execution timed out |
1058 ms |
12996 KB |
Time limit exceeded |
93 |
Execution timed out |
1032 ms |
13052 KB |
Time limit exceeded |
94 |
Execution timed out |
1091 ms |
13000 KB |
Time limit exceeded |
95 |
Execution timed out |
1072 ms |
12996 KB |
Time limit exceeded |
96 |
Execution timed out |
1093 ms |
13004 KB |
Time limit exceeded |
97 |
Execution timed out |
1062 ms |
12984 KB |
Time limit exceeded |
98 |
Execution timed out |
1078 ms |
12948 KB |
Time limit exceeded |
99 |
Execution timed out |
1080 ms |
12996 KB |
Time limit exceeded |
100 |
Execution timed out |
1029 ms |
12952 KB |
Time limit exceeded |