# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
833176 | vjudge1 | Bomb (IZhO17_bomb) | C++17 | 40 ms | 7100 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m, lebar, tinggi, satu;
bool flag=true;
ll ans;
string s[2505];
cin>>n>>m;
for(int i=0; i<n; i++){
cin>>s[i];
}
lebar=m;
tinggi=n;
satu=0;
int j;
for(int i=0; i<n; i++){
j=0;
satu=0;
while(j<m){
if(s[i][j] == '1'){
satu++;
flag=false;
}
else{
if(satu>0) lebar=min(lebar, satu);
satu=0;
}
j++;
}
if(satu>0) lebar=min(lebar, satu);
}
for(int i=0; i<m; i++){
j=0;
satu=0;
while(j<n){
if(s[j][i] == '1') satu++;
else{
if(satu>0) tinggi=min(tinggi, satu);
satu=0;
}
j++;
}
if(satu>0) tinggi=min(tinggi, satu);
}
ans=(ll)tinggi*lebar;
if(flag) ans=0;
cout<<ans<<"\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |