# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
833284 | vjudge1 | Bomb (IZhO17_bomb) | C++17 | 158 ms | 11044 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(int i=0; i<n; i++){
cin >> s[i];
}
//cari minimum di horizontal
vector<int> tmp1;
for(int i=0; i<n; i++){
cnt=0;
for(int j=0; j<=m; j++){
if(j==m || s[i][j]=='0'){
if(cnt>0) tmp1.pb(cnt); cnt=0;
}
else cnt++;
}
}
sort(tmp1.begin(), tmp1.end());
if(tmp1.size()>0) hor=tmp1[0];
//cari minimum di vertikal
vector<int> tmp;
for(int i=0; i<m; i++){
cnt=0;
for(int j=0; j<=n; j++){
if(j==n || s[j][i]=='0'){
if(cnt>0) tmp.pb(cnt); cnt=0;
}
else cnt++;
}
}
sort(tmp.begin(), tmp.end());
if(tmp.size()>0) ver=tmp[0];
cout << hor*ver << endl;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |