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