# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
38356 | mirbek01 | Bomb (IZhO17_bomb) | C++14 | 406 ms | 8144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
# include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
# define pb push_back
# define fr first
# define sc second
# define mk make_pair
using namespace std;
const long long linf = 1e18 + 7;
const int inf = 1e9 + 7;
const int N = 2505;
typedef long long ll;
int n, m, a = inf, b = inf;
char ch[N][N];
int main(){
scanf("%d %d", &n, &m);
for(int i = 1; i <= n; i ++){
scanf("\n");
for(int j = 1; j <= m; j ++)
scanf("%c", &ch[i][j]);
}
for(int i = 1; i <= n; i ++){
int cur = 0;
for(int j = 1; j <= m; j ++){
if(ch[i][j] == '1') cur ++;
else{
if(cur) a = min(a, cur);
cur = 0;
}
}
if(cur) a = min(a, cur);
}
for(int i = 1; i <= m; i ++){
int cur = 0;
for(int j = 1; j <= n; j ++){
if(ch[j][i] == '1') cur ++;
else {
if(cur) b = min(b, cur);
cur = 0;
}
}
if(cur) b = min(b, cur);
}
if(a == inf) printf("0"); else
printf("%d", a * b);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |