# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
171777 | mosiashvililuka | Bomb (IZhO17_bomb) | C++14 | 104 ms | 31160 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;
int a,b,c,d,e,i,j,zx,xc,qw,we,pas,dd,mxa,mxb;
string s;
int f[2509][2509];
int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>a>>b;
for(c=1; c<=a; c++){
cin>>s;
for(d=1; d<=b; d++){
f[c][d]=s[d-1]-'0';
}
}
mxb=mxa=a+b+2;
for(c=1; c<=a; c++){
zx=0;
for(d=1; d<=b; d++){
if(f[c][d]==1){
zx++;
}else{
if(zx!=0) mxa=min(zx,mxa);
zx=0;
}
}
if(zx!=0) mxa=min(zx,mxa);
}
for(d=1; d<=b; d++){
xc=0;
for(c=1; c<=a; c++){
if(f[c][d]==1){
xc++;
}else{
if(xc!=0) mxb=min(mxb,xc);
xc=0;
}
}
if(xc!=0) mxb=min(mxb,xc);
}
cout<<mxa*mxb;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |