# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
474270 | ogibogi2004 | Bomb (IZhO17_bomb) | C++14 | 434 ms | 12700 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const int MAXN=2502;
char t[MAXN][MAXN];
int n,m,maxw,maxh;
int main()
{
cin>>n>>m;
maxh=n;
maxw=m;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
cin>>t[i][j];
}
}
for(int i=1;i<=n;i++)
{
int cnt=0;
for(int j=1;j<=m;j++)
{
if(t[i][j]=='1')cnt++;
else
{
if(cnt>0)maxw=min(maxw,cnt);
}
}
if(cnt>0)maxw=min(maxw,cnt);
}
for(int j=1;j<=m;j++)
{
int cnt=0;
for(int i=1;i<=n;i++)
{
if(t[i][j]=='1')cnt++;
else
{
if(cnt>0)maxh=min(maxh,cnt);
}
}
}
cout<<maxw*maxh<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |