# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
170227 | nvmdava | Bomb (IZhO17_bomb) | C++17 | 135 ms | 6648 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("fma,avx2")
using namespace std;
#define ll long long
#define ff first
#define ss second
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define N 2505
char c[N][N];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m;
cin>>n>>m;
memset(c, '0', sizeof c);
for(int i = 1; i <= n; ++i){
for(int j = 1; j <= m; ++j){
cin>>c[i][j];
}
}
int w = 2500, h = 2500;
for(int i = 1; i <= n; i++){
int th = 0;
for(int j = 1; j <= m + 1; ++j){
if(c[i][j] == '0' && c[i][j - 1] == '1'){
h = min(th, h);
th = 0;
} else if(c[i][j] == '1'){
++th;
}
}
}
for(int i = 1; i <= m; i++){
int tw = 0;
for(int j = 1; j <= n + 1; ++j){
if(c[j][i] == '0' && c[j - 1][i] == '1'){
w = min(tw, w);
tw = 0;
} else if(c[j][i] == '1'){
++tw;
}
}
}
cout<<w * h;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |