# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
833406 | vjudge1 | Bomb (IZhO17_bomb) | C++17 | 177 ms | 10308 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define pll pair<ll, ll>
using namespace std;
ll n, m, hor, ver, cnt;
string s[3000];
int main(){
cin >> n >> m;
for(ll i=0; i<n; i++){
cin >> s[i];
}
hor=n; ver=m;
//cari minimum di horizontal
for(ll i=0; i<n; i++){
cnt=0;
bool ujung=1;
for(ll j=0; j<m; j++){
if(s[i][j]=='0'){
if(cnt>0 && !ujung) hor=min(hor, cnt); cnt=0;
ujung=0;
}
else cnt++;
}
}
//cari minimum di vertikal
for(ll i=0; i<m; i++){
cnt=0;
bool ujung=1;
for(ll j=0; j<n; j++){
if(s[j][i]=='0'){
if(cnt>0 && !ujung) ver=min(ver, cnt); cnt=0;
ujung=0;
}
else cnt++;
}
}
cout << hor*ver << endl;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |