# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
474270 | ogibogi2004 | Bomb (IZhO17_bomb) | C++14 | 434 ms | 12700 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |